In this page we will see how to install / upgrade to PHP 5.3.x in Ubuntu 11.10/11.04. If you have already installed PHP5 under Ubuntu and your version is a bit older, then upgrading it is recommended. You can find here the new features for PHP 5.3.x.

To check your current PHP version via the command line, run this command:

php -v

You may get this as returned outputs (for my system, PHP 5.3.10 is installed):

~$ php -v
PHP 5.3.10-1ubuntu0ppa1~oneiric (cli) (built: Feb 15 2012 05:45:53)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
PHP 5.3.10-1ubuntu0ppa1~oneiric (cli) (built: Feb 15 2012 05:45:53)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies

Installing or upgrading to PHP 5.3.x under Ubuntu is very simple thanks to PPAs. You can easily install or upgrade it with the following commands from the terminal:

sudo add-apt-repository ppa:nginx/php5.3

sudo apt-get update

sudo apt-get install php5

Check again your PHP version to see if the installation is successful. The current latest PHP version in this PPA is PHP 5.3.10.
 
Top