Howto upgrade PHP 5.1 to 5.2

How to upgrade PHP 5.1 to 5.2 on CentOS 5.x. The need to upgrade your php version passed the stable repositories provided by CentOS varys and luckly CentOS provides a Testing Repo for doing this.

Enabling CentOS Testing Repo

Edit with nano or vi

and copy and paste the following

# CentOS-Testing:
# !!!! CAUTION !!!!
# This repository is a proving grounds for packages on their way to CentOSPlus and CentOS Extras.
# They may or may not replace core CentOS packages, and are not guaranteed to function properly.
# These packages build and install, but are waiting for feedback from testers as to
# functionality and stability. Packages in this repository will come and go during the
# development period, so it should not be left enabled or used on production systems without due
# consideration.
name=CentOS-5 Testing

From here all that is needed is to simply check what PHP packages you currently have and then upgrading them.

Checking current packages

rpm -qa |grep php

Upgrading PHP

yum update

Restart apache to allow it to see the new version of PHP

service httpd restart

Check the new versions of PHP

rpm -qa |grep php

For futher notes about the upgrade see CentOS’s Wiki below.


Leave a Reply