How to update to PHP 5.3.10 in 10.04?

For anyone who wants to upgrade Ubuntu 10.04 LTS to PHP 5.3.10, this is how I have done it:

sudo apt-get remove --purge php*  
sudo apt-get autoremove  
sudo add-apt-repository ppa:l-mierzwa/lucid-php5
sudo apt-get update  
sudo apt-get install php5 libapache2-mod-php5 php5-cli php5-cgi php5-mysql php5-gd  
sudo service apache2 restart  
sudo pecl uninstall apc  
sudo pecl install apc  

It looks a bit drastic using sudo apt-get remove --purge php* but Ubuntu does proceed to list a load of files that get filtered but then ignored and I have successfully upgraded 3 times so far.

Good Luck and thanks to Brian Mercer for his php5 PPA.

[Update 2014-11-05]

From Ondřej Surý's launchpad site:

  • PHP 5.4 : ppa:ondrej/php5-oldstable
  • PHP 5.5 : ppa:ondrej/php5
  • PHP 5.6 : ppa:ondrej/php5-5.6

jrsalunga, you can try pulling in the 5.3.10 packages from precise (just updated last week), though it may not compile without modification:

apt-get install ubuntu-dev-tools
pull-lp-source php5 precise
dpkg-source -x php5_5.3.10-*.dsc
apt-get build-dep php5
cd php5-5.3.10
debuild binary

This will take a long time, and may fail because of all of the changes between 10.04 and 12.04. However, if it succeeds, the .debs produced should be fully installable on 10.04.


Thanks to Dig for the info on the 3rd party PPA for PHP 5.3.10. I was able to upgrade my 10.04 install using those instructions.

One hiccup during the upgrade was that I did not have apt-add-repository available on my system. It turns out this is provided by the package python-software-properties.

For anyone with the same issue, install it with:

sudo apt-get install python-software-properties

You should then have apt-add-repository available on your system.