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

Vincent Composieux:
Run a Symfony application using Docker and docker-compose (English)
Apr 30, 2015 @ 10:53:48

Vincent Composieux has put together a new tutorial showing you how to get a Symfony2 application up and running inside of a Docker virtual machine for development and testing.

Why boot a full virtual machine when you can only run Docker containers of what you need to develop your Symfony applications ? This is one question asked by Jeremy Derusse at his "Docker dans le développement l'intégration continue" talk during Symfony Live Paris 2015. Those slides are really interesting, I invite you to take a look. They demonstrate the power of Docker and docker-compose but are waiting for practice in order to well understand. So I enjoyed a rainy week-end for further study!

He then outlines the components needed for a simple Symfony2 application: Nginx, PHP (well, PHP-FPM), MySQL and, of course, the code for the application. He includes the full contents for the "docker-compose.yml" configuration file to generate this Docker instance. He walks through each of the components it requires and talks about what they contain and how to define each of them as an image. Following this, he creates the containers with a "docker build" and brings it all up and working with one "docker up" command. He also includes a few other helpful commands for getting memory/CPU usage as well as removing all containers and images with a single command.

tagged: symfony2 application docker tutorial dockercompose nginx mysql phpfpm

Link: http://vincent.composieux.fr/article/run-a-symfony-application-using-docker-and-docker-compose

DigitalOcean Community Blog:
How To Set Up a Two Node LEPP Stack on CentOS 7
Mar 25, 2015 @ 11:52:30

On the DigitalOcean community blog they've posted a guide to setting up a LEPP server (Linux, Nginx, PHP and PostgreSQL) on a CentOS 7 instance (not specific to their own platform either, can be applied anywhere).

In this tutorial, we will create a simple web application in a two-tier architecture. Our base operating system for both nodes will be CentOS 7. The site will be powered by an Nginx web server running PHP code that talks to a PostgreSQL database. Instead of adopting a "top-down" approach seen in other LAMP or LEMP tutorials, we will use a "ground-up" approach: we will create a database tier first, then the web server and then see how the web server can connect to the database. We will call this configuration a LEPP (Linux, Nginx, PHP, PostgreSQL) stack.

They create a two-tier setup that involves the use of two CentOS systems (with examples from their own hosting options) and walk you through:

  • Installing PostgreSQL
  • Configuring PostgreSQL
  • Updating the Database Server Firewall
  • Creating and Populating the Database
  • Installing Nginx
  • Updating the Web Server Firewall
  • Configuring Nginx
  • Installing PHP
  • Configuring PHP
  • Creating the Web Application

It seems like a lot of steps but all of the necessary commands and configuration updates are included in each step so it's basically a copy and paste kind of walk-through.

tagged: tutorial centos leep linux nginx php postgresql walkthrough

Link: https://www.digitalocean.com/community/tutorials/how-to-set-up-a-two-node-lepp-stack-on-centos-7

Servers for Hackers:
Deployment with Envoy
Feb 11, 2015 @ 13:09:31

The Servers for Hackers site has a new post walking you through the steps to deploy a PHP application with Envoy, the Laravel-based ssh task runner to make automated deployment simpler.

We'll use Laravel's Envoy to deploy a PHP application to a production server. This will make a new release directory, clone the repository into it, run any needed build steps, and then finally swap the new code out with the older code, so that Nginx and PHP-FPM serve the new code.

They walk you through the full setup you'll need to get the deployment working including generating ssh keys, installing Envoy globally and making the first Envoy configuration file. With that in place and working, he enhances it with quite a few more steps including checking out a new version of the repository to a "release" directory, executing Composer to pull in needed libraries and changing the symlink to point the document root and the freshly installed version. He also includes the configuration for the Nginx server to set up a Laravel-based application inside of a Vagrant VM instance.

tagged: envoy deployment laravel tutorial nginx configuration automation

Link: https://serversforhackers.com/deploy-envoy/

Three Devs & A Maybe Podcast:
Three Devs and a Aimee
Jan 19, 2015 @ 09:17:21

The Three Devs and a Maybe podcast has released their latest episode of their show - episode #54, Three Devs and a Amiee with hosts Michael Budd, Fraser Hart, Lews Cains and Edd Mann.

It is the first show of the new year! In this weeks episode we first reflect on how our holiday breaks went, and what happened to Edd's face?! Fraser's move up to Greenwich is next discussed, including how useful the taxi app 'Uber' is. We then move on to talk about Mick's experiences compiling Apache and PHP from source, along with CodeIgniter's decision to maintain 5.2 support. This leads on to conversation about the upcoming PHP UK Conference, along with tuning queries for the database query planner. Finally, we highlight the differences between Apache and nginx, along with their use of PHP-FPM.

Other topics mentioned include:

You can listen to this latest show either through the in-page audio player or by downloading the mp3 to listen whenever. If you enjoy the show, be sure to subscribe to their feed too.

tagged: threedevsandamaybe podcast ep54 holiday apache codeigniter phpuk nginx phpfpm

Link: http://threedevsandamaybe.com/three-devs-and-a-aimee/

Mattias Geniar:
The PHP circle: from Apache to Nginx and back
Nov 20, 2014 @ 10:26:28

In this new post to his site Mattias Geniar goes in circles...from Apache to Nginx and back in terms of how it relates to PHP.

As with many technologies, the PHP community too evolves. And over the last 6 or 7 years, a rather remarkable circle has been made by a lot of systems administrators and PHP developers in that regard.

He talks about the "early days" and the rise of Apache as the "A" in the LAMP stack. Then Nginx was created/released and PHP developers saw it as a viable option. He talks about how PHP worked with this server and the solutions that were found to "hack" them together. There were issues around the relationship, though, and - in the author's perspective - the circle has come back around to Apache, just with a bit more smarts about how it's configured.

tagged: circle apache webserver nginx opinion configuration phpfpm

Link: http://ma.ttias.be/php-circle-apache-nginx-back/

SitePoint PHP Blog:
How to Run Multiple Versions of PHP on One Server
Nov 07, 2014 @ 10:54:27

The SitePoint PHP blog has a new tutorial by Thien Tran Duy showing you how to run multiple versions of PHP all on the same server. The key is in using a few custom configuration options (you'll be compiling PHP manually for this) to place the different versions in different locations.

In this particular post, we’ll demo a solution to install multiple versions of Phalcon and PHP and run them on a single web server. PHP 5.5.x and 5.6.x will be used here, but you can replace them with other versions. Any servers that support PHP-FPM should be enough but we recommend using Nginx. The environment used in this tutorial is Fedora OS – a Linux system, but the instructions are almost identical for any other *nix OS.

The tutorial also includes the installation of a few other PHP extensions including APC caching, memcache and ioncube. He walks you through the installation of Nginx first to get the web server up and running. Then he starts in on the PHP installs and the requirements to ensure you have to be able to compile from the PHP source. He shows how to pull the different versions of PHP down (5.3, 5.4, 5.6 and master) from the GitHub repository and execute the "buildconf" to make the configure script. He includes the example configuration command with options, ensuring it will work with PHP-FPM and the Nginx server. He then reproduces the process, making slight changes, for the other versions of PHP. Finally, he shows the installation of the two different versions of Phalcon and configuring it to all work with the installed web server.

tagged: multiple version one server language tutorial phpfpm nginx

Link: http://www.sitepoint.com/run-multiple-versions-php-one-server/

Stephan Hochdörfer:
Silex running on HHVM
Apr 09, 2014 @ 09:14:12

Stephan Hochdörfer has a quick new post to his site today showing how he was able to setup a Silex-based application to run on the HHVM (HipHopVM) from Facebook.

First of all I assume you already got HHVM running with nginx. If this is not the case feel free to follow these steps to get everything up and running. To install Silex we will use Composer, so let`s install all the needed requirements and Composer itself.

He includes all the commands you'll need to get the Composer dependencies installed (curl, git, unzip) and to pull it down and move it to the right location post-install. He adds a line to his ".bashrc" to enable it for HHVM and creates the sample "composer.json" for the Silex install. Finally, he includes the updates to make to the nginx configuration to handle the needed redirects to the Silex front controller.

tagged: hhvm silex install configure nginx tutorial framework

Link: http://blog.bitexpert.de/blog/silex-running-on-hhvm/

SitePoint PHP Blog:
CMS Showdown: Nginx, Ghost, PHP and Phalcon
Mar 20, 2014 @ 12:58:18

On the SitePoint PHP blog today Bruno Skvorc has written up the first part of his look at installing Ghost with Nginx and Phalcon on his hosting provider. This is the first post in his "showdown" series of trials on various CMS systems.

You might be wondering why I’m writing about Ghost on a PHP oriented channel – this series will be a showdown of all the various PHP based CMS’ I can find, benchmarked against each other and against Ghost, as I look for the next best alternative. Since my DigitalOcean droplet already runs Nginx as a reverse proxy for the blog, I’ll also be deploying all the CMS’ on that same installation, each on its own subdomain.

He walks you through the whole process from start to finish:

  • Installing PHP on Nginx
  • Setting up a virtual host on a subdomain
  • Installing Phalcon
tagged: sitepoint cms showdown nginx phalcon ghost

Link: http://www.sitepoint.com/cms-showdown-nginx-ghost-php-phalcon

Inviqa techPortal:
Speedy Sites: Nginx and PHP
Feb 21, 2014 @ 11:55:17

On the Inviqa techPortal site today they have a new post from Barney Hanlon in his "Speedy Sites" series. This time he looks at using nginx to speed up your PHP applications.

In the previous article in this series, we looked at using Apache with mod_pagespeed to perform on-the-fly enhancements to decrease page load times. Getting an optimised page is only half the battle however; we need to ensure that our backend is doing as little work as possible in order to be highly scalable. In this article, we look at how we can achieve this while improving performance – all with nginx.

He starts with an introduction to nginx for those not familiar with this alternative web server and how it integrates with PHP. He walks you through the installations and configuration of a basic setup and running some benchmarks with siege. Finally, he shows how to enable PHP support on the install via the "php5-fpm" package (FastCGI).

tagged: speed webserver nginx fastcgi fpm install configure tutorial

Link: http://techportal.inviqa.com/2014/02/20/speedy-sites-nginx-and-php/

SitePoint PHP Blog:
Nginx, PHP5.5 and Phalcon on OpenShift
Jan 02, 2014 @ 10:43:42

On the SitePoint PHP blog today Bruno Skvorc goes through the full installation process around getting Nginx and Phalcon up and running on an OpenShift instance.

In this tutorial, adapted from the step by step trial and error procedure of duythien, and with his full blessing, we'll cover the installation procedure of Phaclon on yet another environment: OpenShift. The procedure is bloody – OpenShift does not make it easy for us to deploy custom environments – but the rewards are well worth it.

As he mentioned, it's not the easiest process, but he's laid it all out there to help make it simple for you. He's broken it up into a number of different steps:

  • Setting up your OpenShift account (using the free tier)
  • Creating and cloning an application
  • Cloning a helper repo with a ".openshift" file included
  • Grabbing the latest Phalcon and making the config file to set it up correctly
  • Configuring Nginx
tagged: nginx phalcon openshift tutorial install configure

Link: http://www.sitepoint.com/nginx-php5-5-phalcon-openshift