How to install php 5.4.4 (or newer version of 5.4) on ubuntu 12.04 LTS?

Using apt-get upgrade I can only get 5.3.10-1ubuntu3.11. The newest version of Moodle, Moodle 2.7 requires php 5.4.4 at least. I am looking to see how this is possible?

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

This comment has been deleted

Thanks for quick response. <br> <br>I had to execute one other command for all of the rest of your commands to work, as the <br> <br>add-apt-repository ppa:ondrej/php5 <br> <br>command did not work. So I looked this failure up on Stackoverflow and executed following command in addition <br> <br>apt-get install python-software-properties <br> <br>After which all went smoothly. My Moodle 2.7 installation on Ubuntu 12.04 using PHP (cli) (built: May 5 2014 09:32:44), (rest of LAMP same as parts of standard package) is now up and running.

To upgrade to a newer version of PHP 5.4 on Ubuntu 12.04, you can use Ondřej Surý’s PPA. He is one of the Debian maintainers of the php5 package. See: <br> <br> <br> <br>To use it, run: <br> <br><pre> <br>sudo apt-get install software-properties-common <br>sudo add-apt-repository ppa:ondrej/php5-oldstable <br>sudo apt-get update <br>sudo apt-get upgrade <br>sudo apt-get install php5 <br></pre>