This guide describes how to upgrade the standard PHP 5.1.x packages in CentOS 5.x 32-bit to the current development versions 5.2.x. These instructions were created using CentOS 5.3 32-bit and with the following PHP packages installed:
# rpm -qa |grep php
php-common-5.1.6-15.el5.i386
php-cli-5.1.6-15.el5.i386
php-5.1.6-15.el5.i386
php-pdo-5.1.6-15.el5.i386
php-bcmath-5.1.6-15.el5.i386
php-ldap-5.1.6-15.el5.i386
php-devel-5.1.6-15.el5.i386
php-gd-5.1.6-15.el5.i386
php-xml-5.1.6-15.el5.i386
php-mbstring-5.1.6-15.el5.i386
php-mysql-5.1.6-15.el5.i386
php-dba-5.1.6-15.el5.i386
As long as you’re using the standard PHP packages on your CentOS server you won’t need to do anything extra. If you’re using extra PHP packages that aren’t part of the standard CentOS repositories (like php-mcrypt) you’ll have to remove them or find updated versions of them.
Add the development repositories
First thing we need to do is add the development repositories to yum. When we add the development repository we’re going to configure it so it only pulls PHP packages. To start we’ll need create a new yum repository configuration file (use your favorite editor):
# /etc/yum.repos.d/CentOS-Testing.repo
Copy/paste the following into this file:
# 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.
[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*
Make sure to remove any spaces at the start of each line, then save and close the file and you’re done.
Read more