First to get PHP 5.4 on CentOS 6 you need to install and enable the EPEL and Remi 3rd party Software Repositories with these commands as root from a shell:
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
Then run the yum install with the Remi repository enabled:
yum --enable-repo=remi install php
Accept the Remi Repository’s Key (or also use the option “-y” on the yum install command line above) and do note that this will upgrade the MySQL Server package too from the Remi Repo (up to mysql-server version 5.5.41-1.el6.remi).
When the yum install is finished, just restart your MySQL Server and Web (Apache by default) server with:
service mysqld restart
service httpd restart
If you need to or want to (check your /var/log/mysqld.log file), you can update some of MySQL’s Internal Tables and such with the command:
mysql_upgrade -uroot -pROOTMYSQLPASSWD
(use your root mysql user’s password there of course :))
FYI,
Richard.