First Check PHP version that is currently installed
$ php -version
Check Linux Version
$ cat /etc/*-release (or redhat-release)
Create a repo file with the content given below. As you can note, we are looking for package upgrade related to php only.
$ vi /etc/yum.repos.d/CentOS-phpupgrade.repo
# CentOS5-Upgrade:
# 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.
[cent5-upgrade]
name=CentOS5 Upgrade
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*
Update the repository
$ yum update
Restart Apache server
$ service http restart
Check the PHP version that is installed
$ php -version
Check the package repository
$ rpm -qa | grep php