Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I cannot update my VPS PHP as it's version 5.1.6 as doing this:

php -v

PHP 5.1.6 (cli) (built: Nov 29 2010 16:47:37)

If I do

yum update php

It will say

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * addons:
 * base:
 * extras:
 * updates:
Setting up Update Process
No Packages marked for Update

How can I force it to upgrade to the latest PHP?

My VPS is CentOS 5.5 32bit.

share|improve this question

migrated from Apr 5 '11 at 15:57

This question came from our site for computer enthusiasts and power users.

up vote 2 down vote accepted

Centos 5.6 will fix the problem, you should use yum erase to remove the php packages, and use yum install php53 and any of the php5.3 extensions that you need.

This keeps with the binary update philosophy and will reduce maintenance because the centos packages will get the backported security fixes that Redhat provides for the php version installed.

If the upgrade to CentOS 5.6 isn't possible, try the packages from IUS ( One of the benefits of keeping with a "Safe Repo" such as IUS or EPEL is that the packages will not cause issue with the base OS packages.

yum remove php php-cgi php-cli php-common
yum update
yum upgrade
cat /etc/*release
    should return: CentOS release 5.6 (Final)
yum install php53
share|improve this answer

You have to add a yum repository that has a more up to date version of PHP in it.

Try this on for size:

share|improve this answer
Another tip: I use this: for searching rpms for different distros. – rvs Apr 5 '11 at 16:12
This didn't help at all. It still wouldn't let me update PHP. – MacMac Apr 5 '11 at 18:52
Do you really think OP isn't capable of going to google and typing in "upgrade php from 5.1.6 yum" and reading the first result (your link). I'm not impressed with this answer – iainlbc Apr 16 '11 at 21:15
You'd be surprised how many OPs we get on SU like that. (This question was migrated from there). – Majenko Apr 16 '11 at 21:27
@ianlbc - that's your response? Well, remind yourself where you are, you are at a helpful community and you decided to drop by a "google it, and you'll get answers" don't forget about it may be useful for other people. There was no point of saying that, go cry somewhere instead of here. – MacMac Apr 18 '11 at 10:18

You'll need to compile from source.

share|improve this answer
How can I compile? – MacMac Apr 5 '11 at 13:30
Actually, it's not recommended to compile any packages on binary (rpm & deb) distros. Recommended way is to find rpm (which would perfectly work in your case) or build/rebuild custom rpm package. – rvs Apr 5 '11 at 16:11
In terms of helpfulness this is the equivalent of saying "read the man page". – iainlbc Apr 16 '11 at 22:31

Here's the SRPM package provided by Oracle for RHEL5, it should work in CentOS 5 too.

share|improve this answer

Upgrade to 5.6 if at all possible and use the official repositories, (see Paul S' answer)

If you cannot upgrade to 5.6, heres a repo that'll do the trick for 5.5, just tested on a new CentOS 5.5 VM and it worked out:

rpm -Uvh
yum --enablerepo=webtatic update php

Journal of entire process:

spun up new centos 5.5 VM
yum install php
[root@centos ~]# php -v
    PHP 5.1.6 (cli) (built: Nov 29 2010 16:47:46) 
    Copyright (c) 1997-2006 The PHP Group
    Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
service httpd start
service iptables stop
nano info.php
    <?php phpinfo() ?>

phpinfo screenshot:

rpm -Uvh
yum --enablerepo=webtatic update php
[root@centos html]# php -v
    PHP 5.3.6 (cli) (built: Mar 19 2011 07:44:03) 
    Copyright (c) 1997-2011 The PHP Group
    Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies    
service httpd restart

post update phpinfo:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.