Installing PHP 5.4 in Ubuntu
I’ve been excitedly awaiting some of the new features found in PHP 5.4, in particular array notation and file upload progress monitoring so I decided to try and install PHP 5.4 on Ubuntu. Fortunately there is a repository of prebuilt packages for Ubuntu 11.04 (Natty Narwhal) at http://apt.damz.org/
I recommend using a VM so you don’t mess up any stable PHP install – I only tested this on Ubuntu 11.04 as that’s what was recommended and I already had a VM with it installed.
Installation
Installation is a very simple matter of adding the gpg key:
curl http://apt.damz.org/key.gpg | sudo apt-key add -
Adding the repository to /etc/apt/sources.list:
deb http://apt.damz.org/ubuntu natty php54
Then installing as normal
sudo apt-get install php5 libapache2-mod-php5
