PHP 5.2.10 .debs for Ubuntu 10.4 (Lucid)

0 min read

Ben Holt

Everyone loves the latest-greatest, especially geeks and especially when it comes to geek toys like operating systems. A co-worker, who will go unnamed, couldn't resist the urge to install Ubuntu 10.4 (Lucid) the moment it was released. Ah, the beautiful interface, the cool toys, the modernity, the.... ouch! Hey, what the $#@*, my web sites don't work?!? Unfortunately the latest-greatest is called the bleeding edge for a reason, and sometimes all that new goodness comes with an unhappy surprise. Lucid ships with PHP 5.3, which is the latest-greatest in the PHP world, however Drupal 5.x and 6.x (and as of this writing the yet-to-be-released 7.x) are not compatible with PHP 5.3. What's a poor latest-greatest-loving web developer to do? Fortunately we have options! If you've done some googling you've likely discovered recipies for installing the Karmic PHP 5.2 .deb files on Lucid. Though I haven't tried it, this is reported to work. Rather than taking that option, I chose to rebuild the Karmic sources for PHP 5.2 on Lucid. The main difference being that the resulting .deb packages have been compiled against the newer libraries in Lucid. To my way of thinking this is a cleaner and safer way to do it, and it's essentially the reverse of how a typical "backport" would be done (where newer software is backported to an older operating system by compiling it against the libraries that came with that OS). The attached .deb files are for PHP 5.2.10, built from the Karmic (9.10) sources against the various libraries that ship with Lucid. To use them with Lucid you will need to remove all existing PHP 5.3 packages (dpkg -r <package names>) and then download and install these PHP 5.2 packages (dpkg -i <package names>). Some of these packages are optional, as a minimum you will need php5-common and libapache2-mod-php5. If you're using Drupal you'll likely also want php5-mysql, php5-gd, and php5-curl too. After you have installed these packages you will need to pin them, which will stop Lucid from wanting to upgrade you to PHP 5.3. After that you'll be good to go.