Lets say if we want to install PHP 5.2.5 which is the latest version in the repos you can make use of a RPM repository maintained by Remi. He has a repository for many distros.
(if there is no 5-3 try 5-4 no 5-4 try 5-5 ……..)
# rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm
Now you have remi’s repo in ur system. so to use the remis repo to install your packages you have to tell yum to use the new repo..
(using same context of PHP update follow below given command)
yum –enablerepo=remi update php (package)