1、需要先按照此网址实现:http://www.shuijingwanwq.com/2014/12/26/439/
2、卸载当前的php版本,执行命令,如图1:
yum remove php*
3、安装php5.6版本,执行命令,如图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、执行命令,如图3,报错:如图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、查看phpinfo信息,发现gd.ini与20-gd.ini、imagick.ini与40-imagick.ini,如图4、5:
6、将20-gd.ini、40-imagick.ini删除掉,如图6
cd /etc/php.d/
rm 20-gd.ini
rm 40-imagick.ini
7、执行命令,显示版本为5.6.20,如图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
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/tech/webdev/180250.html