Upgrade PHP 5.1.x to 5.2.x required by WordPress 3.2 in CentOS



I upgraded my site to the latest WordPress 3.2.1. When I browsed to the site for the first time after upgraded it, the screen displayed an error message indicating that WordPress 3.2.1 required 5.2.4 or above to work.

If you are have the standard PHP 5.1.x in CentOS 5.x and trying to upgrade your system to PHP 5.2.x using yum, you probably will encounter the same scenario where yum couldn’t find PHP 5.2.x package for update.

I searched around and found that PHP 5.2.x is included in the development repository.

Firstly, we need to add the development repository to yum. We need to add in the yum repository configuration file so it pulls PHP packages only. Use one of you favourite text editors to create a new yum repository configuration file.

# /etc/yum.repos.d/CentOS-Testing.repo

Copy/paste the following into this file:

[c5-testing]
name=CentOS-5 Testing
baseurl=http://dev.centos.org/centos/$releasever/testing/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-testing
includepkgs=php*

Run the following command to get a list of what PHP packages you have currently installed in your system:

# rpm -qa |grep php

Use yum to update the PHP packages on your system by running the following command:

# yum update

Once yum has completed, run the following command:

# service httpd restart

Finally, if everything goes well, you have PHP 5.2.x running in your system.

Leave a Reply

Your email address will not be published. Required fields are marked *