My previous post, Ubuntu 12.04 (Precise Pangolin) and PHP 5.4, has been extremely popular but I left some work for the user to figure out.
In a nutshell, here is how you install PHP 5.4 in Ubuntu 12.04 (Precise Pangolin).
1. Install the signing key for the PPA (which also adds the sources to apt):
add-apt-repository ppa:ondrej/php5
If the above command is not available, install it using:
apt-get install python-software-properties
2. Now update the package database and then upgrade the system. As part of upgrading, PHP 5.4 will be installed automatically:
apt-get update apt-get upgrade apt-get dist-upgrade
Now, you should have PHP 5.4 installed:
# php -v PHP 5.4.3-4~precise+1 (cli) (built: May 17 2012 13:00:25) Copyright (c) 1997-2012 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
As an aside, at the time of my previous post, PHP Memcache packages were not available from the PPA but that has since been rectified.