
But, after doing sudo apt-get install php5 It’s also possible to update from any PHP version to 5.4 one with exactly the commands above. provide only very old versions by default. This is really cool and a big step forward as Ubuntu, Debian, CentOS etc. Usually a version-update is available a few days after it was been officially released.

Please note: The ondrej/php5-oldstable repository (which is used here) provides the very latest version of the PHP 5.4-branch. Install PHP 5.4.x sudo apt-get install php5Ĭheck the installed version of PHP (if this does not show 5.4.x please restart your apache) php5 -v Sudo apt-get install python-software-propertiesĬheck the available version of PHP (the result is self-explaining, the version on the top is the one that will be installed): apt-cache policy php5ģ.

If you get an error message now, then please do an update first and install the python-software-properties, that need to be necessary to add a package repository: sudo apt-get update sudo add-apt-repository ppa:ondrej/php5-oldstable If Ubuntu says that you need to download a key first, then follow the instructions given in the notice. Add this package-repository to your system.

There’s an excellent and (usually) hassle-free method to install the latest version of PHP 5.4 with 3 simple bash commands:ġ. How to install/setup latest version of PHP 5.5 on Ubuntu 12.04 LTS (Precise Pangolin)Īnd now, let’s install the latest version of PHP 5.4
