Ben's Pro Tips

Tech Tips Made Easy

February 13, 2014 Linux Server Tips, PHP Tips php, php 5.4, php 5.5, ubuntu server, upgrade

Upgrading to PHP 5.5 (or PHP 5.4) on Ubuntu 12.04 Precise Pangolin

To upgrade the default PHP 5.3 to 5.5 and still receive automatic updates, you can do the following:

1) Upgrade and update APT:

sudo apt-get update && sudo apt-get upgrade

2) Add python-software-properties, run:

sudo apt-get install python-software-properties

3) To upgrade to PHP 5.5, add the ondrej PHP repo:

sudo add-apt-repository ppa:ondrej/php5

To upgrade to PHP 5.4, add the ondrej-oldstable repo:

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

4) Run update/upgrade again, this time with dist-upgrade to keep packages from being held back:

apt-get update && apt-get dist-upgrade

5) You should have the latest! Run php -v to make sure:

PHP (cli) (built: Feb 13 2014 15:48:37)


3 to “Upgrading to PHP 5.5 (or PHP 5.4) on Ubuntu 12.04 Precise Pangolin”

  1. Andrew-David Jahchan says...

    Hey Ben!

    Thank you for this post, it was immensely useful 🙂
    I just want to point out that after step 4, you should do:
    sudo apt-get install php5
    to complete the installation.

  2. Howard Jacobson says...

    The instruction for adding the old-stable repository is not correct. The correct syntax is:

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

  3. Kingsley says...

    Please add this to the list as it will save many people countless hours trying to get svn webdav working once again if already installed.

    add-apt-repository ppa:ondrej/apache2
    apt-get update && apt-get upgrade

Leave a comment

Time limit is exhausted. Please reload the CAPTCHA.