Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Laravel News:
Developing a CI Process for Laravel with Codeship and Forge
Jun 05, 2017 @ 13:01:05

On the Laravel News site they've posted a tutorial showing you how to create a CI process for deploying Laravel applications using the Codeship and Forge services.

Codeship empowers developers to efficiently test and deploy web applications with a basic command. Today, I want to demonstrate some of the platform’s features through testing and deploying a Laravel application.

They start the tutorial with some of the things you'll need to have set up prior to the process including a local instance of Docker, a DigitalOcean or AWS account and a Laravel Forge account. The tutorial then shows how to complete the process using this sample application:

  • Setting up our Codeship project
  • Setting up Laravel Forge
  • Connecting Forge and Codeship

The article walks you through all the setup and configuration you'll need to get the process integrated and up and running quickly.

tagged: laravel deployment codeship forge tutorial integration

Link: https://laravel-news.com/ci-process-codeship-forge

Master Zend Framework:
How to Go From Development to Deployment with Docker
Jun 01, 2017 @ 13:13:58

The Master Zend Framework series has posted the third part in their series covering deployment and development setups with Docker. In this latest article Matthew Setter builds on the knowledge from the first and second parts of the series and shows how to deploy your environment to production.

In my search to learn how to use Docker as a complete solution to develop with, I've found a range of tutorials which discuss or walk through some part of the process.

Sadly, no one tutorial contains all the steps necessary to step you through containerizing an (existing) application through to deploying said application in a production environment. Given that, my aim in writing this tutorial is to show you how to do this.

The challenge in doing so, unfortunately, is that there's a lot to learn and absorb. [...] So this is going to be a lengthy post. But I've aimed to provide the most direct path to your first production deployment, as well as to structure it so that it's easy to work through or navigate to the specific part you need.

He starts off with a few prerequisites you'll need to complete the process - a DigitalOcean account, a Docker Hub account, Docker installed and working and a project to deploy. The rest of the post is broken down into a few sections to make it a bit more consumable:

  • Create & Build the Container
  • Store the Image in an Accessible Registry
  • Build a Deployment Configuration
  • Make the Deployment

For each step in the process all of the code, configurations an commands you'll need are included. In some places screenshots are also included to help you ensure you're on the right path.

tagged: development deployment docker tutorial series production

Link: http://www.masterzendframework.com/docker-from-development-to-deployment/

Matt Stauffer:
How to set up your Laravel application for zero-downtime (Envoyer/Capistrano) deploys
Mar 30, 2017 @ 09:58:35

Matt Stauffer has a post to his site today sharing a step-by-step guide to setting up your Laravel application for zero downtime deploys when using the Envoyer/Capistrano combination.

The reason you're getting zero-downtime deploy from these tools is because the entire deploy process—clone, composer install, etc.—doesn't happen in the directory that is currently serving your site. Instead, each new release gets its own separate "release" directory, all while your site is still being served from its current "release" directory.

All of these release directories are just subdirectories of releases. Each directory here represents one of your deploys, and each directory individually has everything needed to serve your site. [...] So, once the build process is complete for each new release, your deploy tool will delete the current symlink and create a new current symlink that points to your latest release. Boom. Now that release is live.

He then relates this back to the deployment of a Laravel application with Envoyer which already follows this "symlink deploy" method. There's a few caveats he mentions with this deploy, however, including information that shouldn't be removed in each deploy (like caches or configuration files). He then provides the steps (commands) you can follow with the deploy to manually use the "symlink deploy" method in your own scripting.

tagged: laravel deployment envoyer capistrano manual symlink tutorial

Link: https://mattstauffer.co/blog/how-to-set-up-your-laravel-application-for-zero-downtime-envoyer-capistrano-deploys

Zend Framework Blog:
Create ZPKs the Easy Way
Mar 22, 2017 @ 09:05:17

On the Zend Framework blog Enrico Zimuel has posted a tutorial showing you how to easily create ZPKs and package up your application for deployment on Zend Server.

Zend Server provides the ability to deploy applications to a single server or cluster of servers via the ZPK package format. We have offered zf-deploy for creating these packages from Zend Framework and Apigility applications, but how can you create these for Expressive, or, really, any PHP application?

They start by listing out some of the requirements you'll need to get started (the zip binary, Composer, etc). The tutorial then walks you through the setup including the contents of the .htaccess and deployment.xmlconfiguration files. It then walks through the installation of dependencies and actually creating the ZFK (via the zip binary). It wraps up with a simple example of the creation of a ZPK containing a single index.php file.

tagged: zendframework zendserver zpk zip package deployment tutorial

Link: https://framework.zend.com/blog/2017-03-21-create-zpks-the-easy-way.html

SitePoint PHP Blog:
Crash Course: Continuous Deployment with Semaphore CI
Mar 13, 2017 @ 12:42:23

On the SitePoint PHP blog there's a new post that gives you a crash course in using Semaphore, a "continuous delivery pipeline" service, and how to use it to deploy your PHP applications.

Understanding continuous delivery, a now already long-standing buzzword, is not a problem, but implementing it in the right way has been a challenge for quite a few of us, and one we’ll discuss in this post.

[...] In this article, we will cover the process of deploying a Laravel application on a Digital Ocean server through a continuous delivery pipeline using Semaphore. The source code for the application is present on Github.

They walk you through each step of the way (complete with screenshots) to:

  • Create a Semaphore account, linking it to GitHub
  • Creating a new Project
  • Setting up the plan for the deployment
  • Performing the first build
  • Parallelizing the builds

With the project all set up the tutorial then starts on the continuous deployment changes, adding in a "Deployment" step and making a first push.

tagged: crashcourse continuous deployment semaphoreci tutorial setup configuration

Link: https://www.sitepoint.com/crash-course-continuous-deployment-semaphore-ci/

AWS Developer Blog:
Automating the Deployment of Encrypted Web Services with the AWS SDK for PHP (Pa
Feb 17, 2017 @ 12:25:48

The Amazon Web Services blog has posted the second part of their series covering the automated deployment of encrypted web services with the AWS SDK. In this new tutorial (part two, part one is here) they continue with the deployment of services: AWS Elastic Beanstalk, Amazon Route 53 and Amazon CloudFront.

In the first post of this series, we focused on how to use Amazon Route 53 for domain registration and use Amazon Certificate Manager (ACM) to create SSL certificates. With our newly registered domain available for use, we can proceed to deploy and configure the services we need to host the www.dev-null.link website across an encrypted connection. Once complete, the infrastructure configuration will reflect the diagrams [included in the post].

The tutorial then walks you through each of the services you need to deploy and shares the code (using the AWS PHP SDK) to show how to automate the process. There's also a few screenshots included of various page results and admin UIs to help you be sure you're in the right place.

tagged: aws amazon deployment encrypted webservice sdk tutorial series part2

Link: https://aws.amazon.com/blogs/developer/automating-the-deployment-of-encrypted-web-services-with-the-aws-sdk-for-php-part-2/

SitePoint PHP Blog:
How to Properly Deploy Web Apps via SFTP with Git
Nov 29, 2016 @ 11:53:49

On the SitePoint PHP blog there's a new tutorial posted showing you how to properly deploy applications with SFTP and Git. In their examples they build a PHP-based deployment process that uses a few handy packages to make the flow simpler than a set of manual commands.

Uploading files is an integral aspect of any deployment process, and the underlying implementation can vary depending on the type of your server.

[...] The PHPSECLIB (PHP Secure Communications Library) package has an awesome API for routine SFTP tasks: it uses some optional PHP extensions if they’re available, and falls back on an internal PHP implementation otherwise. You don’t need any additional PHP extension to use this package, the default extensions that are packaged with PHP will do. In this article, we will first cover various features of PHPSECLIB – SFTP, including but not limited to uploading or deleting files. Then, we will take a look at how we can use Git in combination with this library to automate our SFTP deployment process.

They start with a quick command (Composer) to get the phpseclib library installed but then quickly move into using it and some SSH keys to:

  • authenticate to the server with public/private keys
  • uploading a sample file
  • automating the deployment with Git, pushing only changed files from a local git repo
  • getting the contents of a specific commit
  • the actual push of the files via SFTP

There's also a few other helpful hints included showing how to manage permissions on the remote server, execute remote commands and downloading files. The post ends with links to other similar tools if you're interested in more complete approaches.

tagged: deploy application sftp git deployment tutorial phpseclib example

Link: https://www.sitepoint.com/how-to-properly-deploy-web-apps-via-sftp-with-git/

Deployer Blog:
How to deploy Laravel application
Nov 22, 2016 @ 12:39:30

In a new post to their blog the Deployer project (a PHP-based deployment tool) has shared a quick tutorial about deploying Laravel applications using the tool and just a few simple commands.

Apparently you already have some Laravel application and some server or shared hosting. Now you need to automate the process of deployment. Deployer will helps you in this as it ships with some ready to use recipes for Laravel based application.

They start with the details about installing the tool then share the single "dep init" command to create the deployment configuration needed to deploy a default Laravel application. There's a few modifications you'll need to make for your own project (like repository location, server information and the path to your SSH key) but that's basically it. The "dep deploy" command can then be used to push the release to the remote server in a "current" directly ready and waiting for your web server to serve up.

tagged: deployer deployment tool tutorial laravel application setup

Link: https://deployer.org/blog/how-to-deploy-laravel

Dailymotion.com Engineering Blog:
PHP 7 deployment at Dailymotion
Oct 18, 2016 @ 13:53:51

On the Dailymotion.com Engineering blog there's a recent post detailing their experiences moving their services to PHP 7 and some of the discoveries they made along the way.

In march 2015, we started to think that code refactoring and architecture improvements, will not be the only way to optimize the response time on dailymotion.com. This is the core problem of websites with high load : “how to scale without investing too much in people/servers”.

They started out by looking into Facebook's HHVM project to potentially replace the default PHP interpreter with a better performing core. They mention incompatibilities they discovered and some of the results in testing it on a handful of servers in production. They had some time to play with things so they waited until PHP 7 was officially released and tried that to make an equal comparison. In the end, they ultimately chose to go with PHP 7 as it was the route with less "friction" and work on changes for their current codebase. The post also includes graph output of some of the improvements they saw when

tagged: dailymotion engineering php7 deployment experience

Link: http://engineering.dailymotion.com/php-7-deployment-at-dailymotion/

How is everyone doing development locally today?
Sep 23, 2016 @ 12:08:17

On the /r/php subreddit from Reddit.com there's a post from Spvrtan asking the community what technologies they're using for local development in their day to day development work.

It's honestly been over 5 years since I last touched PHP on the back-end. At that time, other than "doing it live", XAMPP was the top dog for local environments. Is there a new player in the space or should I go with the same? I've been working primarily as a front-end engineer for the past few years during my full-time employment roles and touched the back-end on projects I've worked on but they've all been Java-based.

They also ask what other developers are using for their deployment tools and pipelines. Answers to the post so far include some of the usual tools and methods including:

  • Docker
  • puphpet (for use with Vagrant)
  • Homestead from Laravel

Other comments also mention the manual creation of virtual machines and even support for local installations rather than virtual ones. What's your development environment like? Head over to the topic and share your own setup too.

tagged: reddit rphp local development virtualmachine opinion deployment

Link: https://www.reddit.com/r/PHP/comments/54487o/how_is_everyone_doing_development_locally_today