How do I upgrade from PHP 5.3 to PHP 5.4.6 in Ubuntu?

Installing PHP 5.4.* on Ubuntu 12.04

Simply add the PPA repository:

sudo add-apt-repository ppa:ondrej/php5-oldstable

And install it:

sudo apt-get update
sudo apt-get install php5

You may need to install add-apt-repository on Ubuntu 12.04. To do so, run the command:

sudo apt-get install python-software-properties

Other New Versions

For PHP 5.5 (currently 5.5.30) add the PPA repository instead:

sudo add-apt-repository ppa:ondrej/php5

For PHP 5.6 (currently 5.6.14) add the PPA repository instead:

sudo add-apt-repository ppa:ondrej/php5-5.6

Hai Look at the following page to update PHP 5.4 in Ubunthu

http://www.zimbio.com/Ubuntu+Linux/articles/D_AsJR2qAL6/How+Upgrade+PHP+5+4+Ubuntu

You can update by apt-get command in terminal. Open Terminal and login to su user . then try the following command to update

add-apt-repository ppa:ondrej/php5
apt-get update
apt-get install php5

If you try in local user means, use sudo before all commands...

WARNING: - this will also auto-upgrade Apache (now 2.4) which has additional consequences, i.e. there are big config changes between Apache 2.2. and 2.4 that will prevent the Apache service from running afterwards!