I have a set of PHP-based websites hosted on a single Ubuntu 12.04 server that I need to upgrade PHP for. However, as some of the sites are QA / staging and others are production, I need to do this progressively. That is, I would like the QA sites to go first so I can check that upgrading PHP does not break anything, before rolling out to production. What's the best way to go about this?
The sites are all served through Apache and have their own vhost file.
I'm imagining that I can (somehow) install a new version of PHP at a specific point and through configuration (Apache? vhost?), specify that a site uses this version of PHP (rather than the one at
The PHP versions in question are fairly old: I'm upgrading from PHP 5.3 to 5.4 at this point. Although (obviously) I need to get to 5.6 pretty soon. So I'm after a process that I can re-use.