How to upgrade to PHP 5.4 on Ubuntu 12.10

PHP 5.4 is not in the standard Ubuntu 12.10 repositories. We will use a backported version of PHP 5.4 by configuring a 3rd party PPA. Open a terminal and run the following commands:

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ondrej/php5-oldstable
sudo apt-get update; sudo apt-get install php5

If you compiled or installed any PHP extensions via pecl then you will need to reinstall those too. Development packages must be upgraded before you run pecl or phpize:

sudo apt-get install php-pear php5-dev

Test if everything is ok by running phpinfo(); from a PHP script on your web-server and php -i from your terminal.

Enjoy!

Mar 31, 2014 Unix-like

Support this blog

Buy yourself ANYTHING!

That's right! Shop as you normally would using Amazon.com with my affiliate link and the commissions made go directly into keeping this blog healthy. It's that simple! The hardware and software costs used for this site comes out of my own pocket and it's expensive. Lets keep this site ad free :)

Start shopping on Amazon.com now!

Thank you!
Richard S.