1. First, follow the instructions at this URL: https://www.shuijingwanwq.com/2014/12/26/439/
2. The current PHP version is PHP 5.3.3.

3. Edit /etc/yum.repos.d/remi.repo and set enabled=1 under [remi]. The [remi] repository represents PHP 5.4, and it also includes 5.5 and 5.6. Here we use 5.4.
![Edit /etc/yum.repos.d/remi.repo and set enabled=1 under [remi]. The [remi] repository represents PHP 5.4, and it also includes 5.5 and 5.6. Here we use 5.4.](https://media.shuijingwanwq.com/2015/06/24.png)
4. Run the yum repolist command to check whether the remi repository was added successfully.

5. Uninstall the programs related to PHP 5.3.3.

6. Install the PHP 5.4 programs by running the command:
yum install php php-mysqlnd php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-cli php-common php-devel php-mbstring php-mcrypt php-soap php-bcmath

7. The command failed because php-mcrypt was still being installed from the EPEL repository, whose latest version is 5.3.3. It needs to be installed from the remi repository to get version 5.4.

8. Edit the /etc/yum.repos.d/epel.repo file and change priority=11 to #priority=1.

9. Install the PHP 5.4 programs again by running the command:
yum install php php-mysqlnd php-gd php-imap php-ldap php-odbc php-pear php-xml php-xmlrpc php-cli php-common php-devel php-mbstring php-mcrypt php-soap php-bcmath

10. The installation succeeded, and the current version is 5.4.42.

11. Checked the phpinfo information, and it is running normally.

