Ubuntu Lucid LTS upgrade PHP

I had the need today to update the version of PHP on Ubuntu Lucid LTS to something that was supported by some code that was being tested.

While not directly exposed, it formed one of a number of chicken and egg scenarios that meant nothing was going anywhere due to demands / constraints from ‘other parties’ this was the only real part I was in a position to do anything about.

Expecting nothing more than flames, whaling, gnashing of teeth, and pain (the obvious time to do this being before a day’s vacation) – imagine my surprise when, actually, no, it only actually worked. Amazing.

So – with the disclaimer of me having a block level CDP backup of this host from pretty much a minute or two before kicking this off:

apt-get remove –purge php*
add-apt-repository ppa:l-mierzwa/lucid-php5
apt-get update
apt-get install php5 libapache2-mod-php5 php5-cli php5-cgi php5-mysql php5-gd
apt-get install zend-framework php5-dev php5-imagick php5-imap php5-mcrypt php5-snmp php5-sybase php-pear libgraphviz4 php5-curl
service apache2 restart
pecl uninstall apc
pecl install apc

This kinda (for me) purged what I had which was 5.3.2 and replaced it with php 5.3.10-1 from the repository (that I had checked over before hand).

The first apt-get ensures that we are up to speed, and the second is all the things that were apparently installed that I have reinstalled in the hope that the world will not fall in around my ears because ‘unnamed in error logs’ is missing and my crystal ball is at the cleaners.

It was all going swimmingly up to the lack of IonCube decryprtion for the newer shiny version as last one had been purged with bells on.

As such the usual dance followed – using the wizard, and then something like the following:

yadda yadda yadda…
wget http://downloads3.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz
tar -zxvf ioncube_loaders_lin_x86-64.tar.gz
cp ioncube/* /var/www/sitename
vim /etc/php5/apache2/conf.d/00-ioncube.ini
cp -vfr ioncube/* /usr/lib/php5/20090626
service apache2 restart
blah blah blah…

Remembering to restart, as otherwise changes to PHP for Apache2 being completely ignored.

YMMV – considerably – but in a squeeze – when the need is high, and the box is still live and the new one is not available due to X – then this – is at best, a workable solution.

*This is an adaptation of this article. Go Google Coding.

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this:
Skip to toolbar