hard working ecommerce websites. hard working people. learn more.

Contact us

PHP 5.2.10 .debs for Ubuntu 10.10 (Maverick)

If you caught my earlier post you'll know I have a co-worker who loves to play with the newest toys. Well, here we are a few short days after Ubuntu 10.10 (Maverick) has been released and he's now loving his upgraded computer except, you guessed it, he needs PHP 5.2 for some of the older drupal sites he has to work on, and Maverick ships with PHP 5.3.

Drupal 6 and 7 core are both PHP 5.3 compatible, however not all of the contrib modules have been updated. Drupal 5 is not PHP 5.3 compatible. What I have posted here (at the bottom of this post) are the latest PHP 5.2 packages from Ubuntu 9.10 (Karmic) compiled on 10.10 (Maverick) and using the 10.10 libraries. Here is a quick run down of how I built them. If you need to forward port anything else (like the Lucid xserver-xorg packages for a video card that require Nvidia legacy 96 drivers) you can go through similar steps.

Don't be surprised if the build fails the first (or more) times. You will have the dependencies for the current Maverick PHP5 packages installed, however the version numbers are almost certainly different than the ones expected by the Karmic PHP5 packages. If the build fails look at the error message(s). For instance, I received a dependency error about libdb. I did a 'dpkg -l | grep libdb' and confirmed that I had libdb4.8 and libdb4.8-dev installed. I then edited the control file (/usr/local/src/php-5.2.10/debian/control) and changed the Build-Depends reference to libdb4.6-dev to libdb4.8-dev and tried building again. In my own case this was the only change I needed to make, however this is likely because I had built the earlier packages on this same Ubuntu install and then upgraded it to Maverick to build these ones, so I had probably made other changes to the control file earlier.

libapache2-mod-php5_5.2.10.dfsg.1-2ubuntu6.5_i386.deb
libapache2-mod-php5filter_5.2.10.dfsg.1-2ubuntu6.5_i386.deb
php5_5.2.10.dfsg.1-2ubuntu6.5_all.deb
php5-cgi_5.2.10.dfsg.1-2ubuntu6.5_i386.deb
php5-cli_5.2.10.dfsg.1-2ubuntu6.5_i386.deb
php5-common_5.2.10.dfsg.1-2ubuntu6.5_i386.deb
php5-curl_5.2.10.dfsg.1-2ubuntu6.5_i386.deb
php5-dbg_5.2.10.dfsg.1-2ubuntu6.5_i386.deb
php5-dev_5.2.10.dfsg.1-2ubuntu6.5_i386.deb
php5-gd_5.2.10.dfsg.1-2ubuntu6.5_i386.deb
php5-gmp_5.2.10.dfsg.1-2ubuntu6.5_i386.deb
php5-ldap_5.2.10.dfsg.1-2ubuntu6.5_i386.deb
php5-mhash_5.2.10.dfsg.1-2ubuntu6.5_i386.deb
php5-mysql_5.2.10.dfsg.1-2ubuntu6.5_i386.deb
php5-odbc_5.2.10.dfsg.1-2ubuntu6.5_i386.deb
php5-pgsql_5.2.10.dfsg.1-2ubuntu6.5_i386.deb
php5-pspell_5.2.10.dfsg.1-2ubuntu6.5_i386.deb
php5-recode_5.2.10.dfsg.1-2ubuntu6.5_i386.deb
php5-snmp_5.2.10.dfsg.1-2ubuntu6.5_i386.deb
php5-sqlite_5.2.10.dfsg.1-2ubuntu6.5_i386.deb
php5-sybase_5.2.10.dfsg.1-2ubuntu6.5_i386.deb
php5-tidy_5.2.10.dfsg.1-2ubuntu6.5_i386.deb
php5-xmlrpc_5.2.10.dfsg.1-2ubuntu6.5_i386.deb
php5-xsl_5.2.10.dfsg.1-2ubuntu6.5_i386.deb
php-pear_5.2.10.dfsg.1-2ubuntu6.5_all.deb

If you need instructions for installing the packages, or pinning them so that Ubuntu doesn't try to upgrade them to PHP5.3, please see my earlier post. It should go without saying, if you use these deb packages you do so at your own risk.

Update

And here are the 64 bits debs:

libapache2-mod-php5_5.2.10.dfsg.1-2ubuntu6_amd64.deb
libapache2-mod-php5filter_5.2.10.dfsg.1-2ubuntu6_amd64.deb
php5_5.2.10.dfsg.1-2ubuntu6_all.deb
php5-cgi_5.2.10.dfsg.1-2ubuntu6_amd64.deb
php5-cli_5.2.10.dfsg.1-2ubuntu6_amd64.deb
php5-common_5.2.10.dfsg.1-2ubuntu6_amd64.deb
php5-curl_5.2.10.dfsg.1-2ubuntu6_amd64.deb
php5-dbg_5.2.10.dfsg.1-2ubuntu6_amd64.deb
php5-dev_5.2.10.dfsg.1-2ubuntu6_amd64.deb
php5-gd_5.2.10.dfsg.1-2ubuntu6_amd64.deb
php5-gmp_5.2.10.dfsg.1-2ubuntu6_amd64.deb
php5-ldap_5.2.10.dfsg.1-2ubuntu6_amd64.deb
php5-mhash_5.2.10.dfsg.1-2ubuntu6_amd64.deb
php5-mysql_5.2.10.dfsg.1-2ubuntu6_amd64.deb
php5-odbc_5.2.10.dfsg.1-2ubuntu6_amd64.deb
php5-pgsql_5.2.10.dfsg.1-2ubuntu6_amd64.deb
php5-pspell_5.2.10.dfsg.1-2ubuntu6_amd64.deb
php5-recode_5.2.10.dfsg.1-2ubuntu6_amd64.deb
php5-snmp_5.2.10.dfsg.1-2ubuntu6_amd64.deb
php5-sqlite_5.2.10.dfsg.1-2ubuntu6_amd64.deb
php5-sybase_5.2.10.dfsg.1-2ubuntu6_amd64.deb
php5-tidy_5.2.10.dfsg.1-2ubuntu6_amd64.deb
php5-xmlrpc_5.2.10.dfsg.1-2ubuntu6_amd64.deb
php5-xsl_5.2.10.dfsg.1-2ubuntu6_amd64.deb
php-pear_5.2.10.dfsg.1-2ubuntu6.5_all.deb

Comments

I find that the method of using previous release packages is a lot easier than building and installing debs.

See http://randyfay.com/node/63

Although the articles says it's for 10.04 (lucid), it can be applied in exactly the same way to 10.10 (maverick).

Cheers!

Running older releases is suboptimal. They may not be linked against the same version of other libraries on your system. If something gets updated, it may break the older versions of PHP that you have.

Having .deb built for the specific release is great, but it you don't have an upgrade path for security patches for example.

So, the best option is to have this in a repository that you can upgrade from.

Once such repository exists for 10.04 and PHP 5.2.

We wrote about it in our various ways for running PHP 5.2 on Ubuntu 10.04 Lucid Lynx.

Yes, a repository of forward-ported PHP5 packages would be great. If you know of one for 10.10 please post it to the comments. Keep in mind that just because there is a repository doesn't mean it is kept up to date and that the packages in it contain the latest security fixes. This is true for any non-distro provided repository whether it is for Ubuntu, Debian, CentOS, RHEL, etc.

For our own purposes, we will be using these packages on our local development desktops and not on production servers, so any security implications are relatively minor. If you are considering these packages for production use you may want to reconsider your choice of linux distribution. The current Debian stable (5.0 aka Lenny) ships with PHP 5.2 packages and would, in my opinion, be a more suitable production environment than a non-LTS Ubuntu. The previous LTS Ubuntu (8.04) would also be worth considering.

What about the php5-mcrypt and php5-imap ? i'm on ub10.10 and i can't go through those ones

There is a repository called dotdeb which contains php 5.2.14 and 5.3.3. (http://www.dotdeb.org/). It has both the mcrypt and imap extensions.
It's build for debian but served my php needs on many ubuntu (and other debian based) installations.

I haven't tested it with 10.10 yet, but I think it shouldn't be a problem.
If there are any missing packages, they can be found in the debian repositories (deb files via the debian website).

I got stuck at the gunzip command.. I got a message that said

patching file debian/php5.lintian-overrides
patch: **** Can't rename file /tmp/pokAfAY6 to debian/php5.lintian-overrides : No such file or directory.

Do you have any idea what I did incorrectly?

Excellent post, thanks to help developers doing drupal on maverick \o/

Alex, it looks like you haven't change the permissions.
Do a chmod -R 777 on /usr/local/src/php5.2
and then redo the steps.

First, this is a fantastic (set of) posts!

I am wondering if you have any advice on running 5.2 and 5.3 in parallel. I'd like to install this shiny new build of 5.2 into it's own home, then have Apache (and probably some command line tools, come to think of it) run different versions, depending either on the virtual host or ideally the directory. I'm already running FCGI. I know it's easier but in this particular case, sticking it into a VM causes more problems.

Hi Alan, I'm glad you found the posts helpful.

My experience with running multiple versions of apache on a single apache instance is very limited. I did a little googling and turned up this post http://ubuntuforums.org/showthread.php?t=341164 which isn't exactly what you are after, but looks like it should be able to get you going pointed in the right direction. A complicating factor will be that apt will likely only allow you to install one instance of PHP5 at a time, so you will likely have to compile from source.

Good luck, let me know how you make out.