1. First, follow the instructions at this URL: https://www.shuijingwanwq.com/2014/12/26/439/
2. Uninstall the current PHP version by executing the command, as shown in Figure 1:
yum remove php*

3. Install PHP 5.6 by executing the command, as shown in Figure 2:
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 php-imagick php-redis –enablerepo=remi,remi-php56

4. Execute the command, as shown in Figure 3, which produces the error shown in Figure 3:
php -v
PHP Warning: Module ‘gd’ already loaded in Unknown on line 0
PHP Warning: Module ‘imagick’ already loaded in Unknown on line 0
PHP 5.6.20 (cli) (built: Mar 31 2016 07:24:47)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

5. Checking the phpinfo reveals gd.ini and 20-gd.ini, as well as imagick.ini and 40-imagick.ini, as shown in Figures 4 and 5:


6. Delete 20-gd.ini and 40-imagick.ini, as shown in Figure 6:
cd /etc/php.d/
rm 20-gd.ini
rm 40-imagick.ini

7. Execute the command, which displays the version as 5.6.20, as shown in Figure 7:
php -v
PHP 5.6.20 (cli) (built: Mar 31 2016 07:24:47)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies

