How to install PHP 5.3 and 5.2 together on Ubuntu

Although Drupals 7+ run smoothly on PHP 5.3, Drupal 6 still feels much better with PHP 5.2. Even though D6 core is compatible with PHP 5.3 for quite some time now, a lot of contributes modules still get nasty hiccup when asked to run on the newer version. Therefore developing for both D7 and D6 at the same time becomes much less painful when running both versions of PHP in parallel.

One way of doing it is using mod_php5 Apache module to serve PHP 5.3 applications, while running PHP 5.2 applications using fastcgi module. Under Ubuntu 12.04 this can be achieved by installing PHP 5.3 from the repositories and manually compiling and installing PHP 5.2 afterwards. Читать далее

Compiling PHP 5.2 for Ubuntu

There are a number of ways of installing PHP 5.2 on Maverick using Ubuntu’s existing package management framework or pre-compiled binaries, some of these methods are dotted across the internet on blogs and such.

I found most of these methods a little bit messy and the risk of unintended consequences stemming from altering the default package management for PHP doesn’t sit well with me. And besides, this is GNU/Linux, we can take the source of PHP and just compile it for our own machines! Читать далее