24

Im setting up a vps for the first time from scratch, the host has a one click LAMP installer which took out allot of the leg work, but running phpinfo(); i found im running 5.3.10.

So id like to update it to 5.4.10 - Ive run sudo apt-get install php5 libapache2-mod-php5 php5-mcrypt but it says php5 is the latest version, any ideas about how to update this ?

The server is running Ubuntu 12.04

sam
  • 313

3 Answers3

34

PHP 5.4.10 is not available in the Ubuntu repositories for 12.04.

You have two options:

(1) try and find a PPA with a backported version of PHP 5.4.10 (such as ondrej's oldstable PPA)

a) Run this command: sudo apt-get install python-software-properties
b) Run this command: sudo add-apt-repository ppa:ondrej/php5-oldstable
c) Run sudo apt-get update; sudo apt-get install php5
d) This should allow you to use PHP 5.4.10 (or whatever the most recent "Old Stable PHP" is).

(2) download PHP from source, and compile it.

5.4.10 does not exist in the repositories for any version of Ubuntu, apparently, so you're stuck with these two options for all releases.

(I can try and backport 5.4.10 from Debian if you would like, but it would be in a PPA, so you'd have to trust that I'm not giving you malware, although I wouldn't do that ever.)

Thomas Ward
  • 78,878
2

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
Kamlesh Kumar
  • 271
  • 1
  • 2
  • 8
0

You don't need to add repositories. Simply use these steps:

  1. sudo add-apt-repository ppa:ondrej/php5-oldstable
  2. sudo apt-get update
  3. sudo apt-get install php5

that's it.