为 php 5.6 安装 GD 库

Installing GD Library for php 5.6

我在 CentOS 机器上工作(版本 6.7).. 我在这台机器上安装了 php 5.6(以前是 5.3),实际上我想安装 PHP 的 GD 库使用此命令行:

sudo yum install php56u-gd

它给了我这个错误信息

Loaded plugins: fastestmirror, replace, security
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: centos.mirror.gtcomm.net
 * elrepo: ftp.osuosl.org
 * epel: ftp.osuosl.org
 * extras: centos.mirror.gtcomm.net
 * ius: ius.mirror.constant.com
 * remi-safe: mirrors.mediatemple.net
 * rpmforge: mirror.us.leaseweb.net
 * updates: centos.mirror.iweb.ca
 * webtatic: us-east.repo.webtatic.com
Resolving Dependencies
--> Running transaction check
---> Package php56u-gd.x86_64 0:5.6.23-1.ius.centos6 will be installed
--> Processing Dependency: php56u-common(x86-64) = 5.6.23-1.ius.centos6 for package: php56u-gd-5.6.23-1.ius.centos6.x86_64
--> Running transaction check
---> Package php56u-common.x86_64 0:5.6.23-1.ius.centos6 will be installed
--> Processing Dependency: php56u-pecl-jsonc(x86-64) for package: php56u-common-5.6.23-1.ius.centos6.x86_64
--> Running transaction check
---> Package php56u-pecl-jsonc.x86_64 0:1.3.9-2.ius.centos6 will be installed
--> Processing Dependency: php56u-pear for package: php56u-pecl-jsonc-1.3.9-2.ius.centos6.x86_64
--> Processing Dependency: php56u-pear for package: php56u-pecl-jsonc-1.3.9-2.ius.centos6.x86_64
--> Running transaction check
---> Package php56u-pear.noarch 1:1.10.1-4.ius.centos6 will be installed
--> Processing Dependency: php56u-xml for package: 1:php56u-pear-1.10.1-4.ius.centos6.noarch
--> Processing Dependency: php56u-posix for package: 1:php56u-pear-1.10.1-4.ius.centos6.noarch
--> Processing Dependency: php56u-cli for package: 1:php56u-pear-1.10.1-4.ius.centos6.noarch
--> Running transaction check
---> Package php56u-cli.x86_64 0:5.6.23-1.ius.centos6 will be installed
---> Package php56u-process.x86_64 0:5.6.23-1.ius.centos6 will be installed
---> Package php56u-xml.x86_64 0:5.6.23-1.ius.centos6 will be installed
--> Finished Dependency Resolution

我该如何解决这个问题? 谢谢

我终于解决了我的问题...以下是我遵循的步骤:

  • 删除 php 及其模块: 在 CentOS 上我使用:

yum remove php php-cli php-common php-gd php-ldap php-mysql php-odbc php-pdo php-pear php-pecl-apc php-pecl-memcache php-pgsql php-soap php-xml php-xmlrpc

  • 重新安装所需的 PHP 模块(我需要): sudo yum install php56w sudo yum install php56w-mysql
  • 最后安装 GD 库:sudo yum install php56w-gd

实际上一切正常