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.