没有不值得去解决的问题,也没有不值得去学习的技术!

How to Upgrade PHP 5.4.43 to 5.6.20 on CentOS 6.5 64-bit with yum

PHP Warning:  Module 'gd' already loaded in Unknown on line 0

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*

yum remove php*
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

Install PHP 5.6
Install PHP 5.6

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

PHP Warning:  Module 'gd' already loaded in Unknown on line 0
PHP Warning: Module ‘gd’ already loaded in Unknown on line 0

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:

Checking the phpinfo reveals gd.ini and 20-gd.ini
Checking the phpinfo reveals gd.ini and 20-gd.ini
Checking the phpinfo reveals imagick.ini and 40-imagick.ini
Checking the phpinfo reveals imagick.ini and 40-imagick.ini

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

Delete 20-gd.ini and 40-imagick.ini
Delete 20-gd.ini and 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

Execute the command, displaying the version as 5.6.20
Execute the command, displaying the version as 5.6.20

关于作者 · 持续学习与技术实践

我是一名拥有 15 年以上开发经验的技术从业者,自 2013 年起持续运营个人技术博客,记录工作与个人项目中遇到的真实问题,以及解决问题过程中的探索、实践和思考。

除了技术写作,我也在持续开发和维护自己的独立项目,探索新技术和新工具在实际场景中的应用。我始终相信,没有不值得去解决的问题,也没有不值得去学习的技术。

如果这篇文章对你有所帮助,欢迎浏览博客中的其他文章,也欢迎交流技术经验与想法。

关于我  ·  GitHub  ·  邮件联系