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'm in the midst of resolving a bunch of security issues on a clients server to get them compliant with credit card laws and such.

The first order of business is getting php from 5.2.14 to 5.2.16.

When I run yum update php, this is the output I get:

Excluding Packages from CentOS-5 - Addons
Excluding Packages from CentOS-5 - Base
Excluding Packages from CentOS-5 - Extras
Excluding Packages from CentOS-5 - Updates
Setting up Update Process
No Packages marked for Update

I'm fairly new to CentOS, but with Debian/Ubuntu, you can add PPAs to allow new software packages. Is there something similar for CentOS? This output makes it look like it's ignoring all the main package repos as well.

share|improve this question
"Base" and "Updates" are the main package repos. If there's no updates there then there's no updates. – Ignacio Vazquez-Abrams Dec 21 '10 at 5:30
up vote 6 down vote accepted

I highly suggest using the IUS Community Project repositories for upgrading your PHP 5.2, and even PHP 5.3 packages on CentOS 5. These are a set of very well maintained and high quality packages, used by Rackspace and maintained, but not supported by them (unless you're a customer of course).

The install instructions can be a little hard to find if you're new to this. You're looking for the client usage guide on their wiki. I will duplicate the instructions here for ease of use.

[root@linuxbox ~]# wget 

[root@linuxbox ~]# wget

[root@linuxbox ~]# rpm -Uvh ius-release*.rpm epel-release*.rpm

This downloads and installs both the EPEL and IUS repos for you.

IUS promises not to use conflicting package names with any of the official repos, including EPEL (this is a great thing), things aren't as simple as yum upgrade php. You will need to first uninstall all of your existing PHP packages, and install the appropriate ones from IUS. Alternatively, you can use the yum-plugin-replace plugin to add a useful "replace" capability to YUM.



[root@linuxbox ~]# rpm -qa | grep php

[root@linuxbox ~]# yum erase php
  • rpm -qa | grep php lists each installed PHP package. You will use this list to install all the appropriate individual PHP packages from IUS
  • yum erase php command just erases PHP and it's dependent packages


[root@linuxbox ~]# yum search php52

[root@linuxbox ~]# yum install php52 php52-common php52-pecl-apc php52-mysql ...
  • yum search php52 lists the available PHP 5.2 packages
  • yum install installs your chosen PHP 5.2 packages. You would use the list you obtained in step one to determine which you needed


[root@linuxbox ~]# yum install yum-plugin-replace

[root@linuxbox ~]# yum replace php --replace-with php52

This will magically determine which PHP packages to erase, and which matching php52 packages to install for you.

share|improve this answer
This left it at php 5.2.14 and didn't update it to 5.2.16 – gregghz Dec 22 '10 at 3:32
sure enough:… doesn't show the latest php 5.2 – gregghz Dec 22 '10 at 3:55
@greggory: Ah, I didn't realize that 5.2.16 was the bleeding edge release. IUS is good about updating, much more frequently than RHEL/CentOS, but they aren't reckless. Add the --enablerepo=ius-testing parameter to those yum install/replace commands. – hobodave Dec 22 '10 at 4:55

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.