Step1. Add EPEL and Remi repositories onto your system:
On CentOS 6.x 32-bit
wget http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
On CentOS 6.x x86_64 (64-bit)
wget http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
Step 2 – Now enable your newly added Remi repo. Open the /etc/yum.repos.d/remi.reporepository file using a text editor of your choice
vi /etc/yum.repos.d/remi.repo
Step 3 – Edit enabled=0 line to enabled=1:
4.a – Update to PHP 5.4, in [remi] section:
4.b – Update to PHP 5.5, in [remi-php55] section:
Step 4 – Now update yum
yum update -y
Step 5 – Done. Now you can check using this command:
php -v
Now you can test your PHP script on your browser and hope everything still runs smoothly.
Source from: http://www.servermom.org/upgrade-php-53-54-55-centos/1534/