Skip to content

Instantly share code, notes, and snippets.

@betweenbrain
Last active December 21, 2015 16:09
Show Gist options
  • Select an option

  • Save betweenbrain/6332044 to your computer and use it in GitHub Desktop.

Select an option

Save betweenbrain/6332044 to your computer and use it in GitHub Desktop.
Upgrade PHP on Ubuntu 12.04 to most recent version

WARNING: This procedure may have adverse side effects. You have been warned!

As the latest official version of PHP supported by Ubuntu 12.04 is 5.3.10, you need to add an external source for more recent versions. The source used is Dotdeb. "The packages from Dotdeb should work on Ubuntu, but no additional support will be provided." - http://www.dotdeb.org/about/

Add Dotdeb as package sources $ sudo nano /etc/apt/sources.list and add:

  • deb http://php53.dotdeb.org squeeze all
  • deb-src http://php53.dotdeb.org squeeze all

Fetch Dotdeb GPG key $ wget http://www.dotdeb.org/dotdeb.gpg

Install Dotdeb GPG key $ cat dotdeb.gpg | sudo apt-key add -

Update package sources $ sudo apt-get update

Upgrade packages and replace with new versions $ sudo apt-get dist-upgrade

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment