Zabbix在Centos7上安装PHP 7 PHP 5.6冲突

Zabbix在Centos7上安装PHP 7 PHP 5.6冲突

我正在尝试在运行 PHP7 的 Centos7 上安装 Zabbix 3.2。

链接到演练

命令:

yum -y install zabbix-get zabbix-server-mysql zabbix-web-mysql zabbix-agent

输出:

Loaded plugins: fastestmirror, langpacks, replace
Loading mirror speeds from cached hostfile
 * base: mirror.us-midwest-1.nexcess.net
 * epel: mirror.steadfast.net
 * extras: mirror.millry.co
 * ius: dfw.mirror.rackspace.com
 * updates: repos-va.psychz.net
Resolving Dependencies
--> Running transaction check
---> Package zabbix-agent.x86_64 0:3.2.6-1.el7 will be installed
---> Package zabbix-get.x86_64 0:3.0.9-1.el7 will be updated
---> Package zabbix-get.x86_64 0:3.2.6-1.el7 will be an update
---> Package zabbix-server-mysql.x86_64 0:3.2.6-1.el7 will be installed
---> Package zabbix-web-mysql.noarch 0:3.2.6-1.el7 will be installed
--> Processing Dependency: zabbix-web = 3.2.6-1.el7 for package: zabbix-web-mysql-3.2.6-1.el7.noarch
--> Processing Dependency: php-mysql for package: zabbix-web-mysql-3.2.6-1.el7.noarch
--> Running transaction check
---> Package php56u-mysqlnd.x86_64 0:5.6.30-2.ius.centos7 will be installed
--> Processing Dependency: php56u-pdo(x86-64) = 5.6.30-2.ius.centos7 for package: php56u-mysqlnd-5.6.30-2.ius.centos7.x86_64
---> Package zabbix-web.noarch 0:3.2.6-1.el7 will be installed
--> Processing Dependency: php-gd for package: zabbix-web-3.2.6-1.el7.noarch
--> Processing Dependency: php-bcmath for package: zabbix-web-3.2.6-1.el7.noarch
--> Processing Dependency: php-ldap for package: zabbix-web-3.2.6-1.el7.noarch
--> Running transaction check
---> Package php56u-pdo.x86_64 0:5.6.30-2.ius.centos7 will be installed
--> Processing Dependency: php56u-common(x86-64) = 5.6.30-2.ius.centos7 for package: php56u-pdo-5.6.30-2.ius.centos7.x86_64
---> Package php71u-bcmath.x86_64 0:7.1.6-1.ius.centos7 will be installed
--> Processing Dependency: php-common(x86-64) = 7.1.6-1.ius.centos7 for package: php71u-bcmath-7.1.6-1.ius.centos7.x86_64
---> Package php71u-gd.x86_64 0:7.1.6-1.ius.centos7 will be installed
---> Package php71u-ldap.x86_64 0:7.1.6-1.ius.centos7 will be installed
--> Running transaction check
---> Package php56u-common.x86_64 0:5.6.30-2.ius.centos7 will be installed
--> Processing Dependency: php56u-pecl-jsonc(x86-64) for package: php56u-common-5.6.30-2.ius.centos7.x86_64
---> Package php71u-common.x86_64 0:7.1.6-1.ius.centos7 will be installed
--> Running transaction check
---> Package php56u-pecl-jsonc.x86_64 0:1.3.10-2.ius.centos7 will be installed
--> Processing Dependency: php56u-pear for package: php56u-pecl-jsonc-1.3.10-2.ius.centos7.x86_64
--> Processing Dependency: php56u-pear for package: php56u-pecl-jsonc-1.3.10-2.ius.centos7.x86_64
--> Running transaction check
---> Package php56u-pear.noarch 1:1.10.4-1.ius.centos7 will be installed
--> Processing Dependency: php56u-cli for package: 1:php56u-pear-1.10.4-1.ius.centos7.noarch
--> Processing Dependency: php56u-posix for package: 1:php56u-pear-1.10.4-1.ius.centos7.noarch
--> Processing Dependency: php56u-xml for package: 1:php56u-pear-1.10.4-1.ius.centos7.noarch
--> Running transaction check
---> Package php56u-cli.x86_64 0:5.6.30-2.ius.centos7 will be installed
---> Package php56u-process.x86_64 0:5.6.30-2.ius.centos7 will be installed
---> Package php56u-xml.x86_64 0:5.6.30-2.ius.centos7 will be installed
--> Processing Conflict: php70u-cli-7.0.19-1.ius.centos7.x86_64 conflicts php-cli < 7.0.19
--> Restarting Dependency Resolution with new changes.
--> Running transaction check
---> Package php70u-cli.x86_64 0:7.0.19-1.ius.centos7 will be updated
---> Package php70u-cli.x86_64 0:7.0.20-1.ius.centos7 will be an update
--> Processing Dependency: php-common(x86-64) = 7.0.20-1.ius.centos7 for package: php70u-cli-7.0.20-1.ius.centos7.x86_64
--> Running transaction check
---> Package php70u-common.x86_64 0:7.0.19-1.ius.centos7 will be updated
--> Processing Dependency: php-common(x86-64) = 7.0.19-1.ius.centos7 for package: mod_php70u-7.0.19-1.ius.centos7.x86_64
--> Processing Dependency: php-common(x86-64) = 7.0.19-1.ius.centos7 for package: php70u-mbstring-7.0.19-1.ius.centos7.x86_64
--> Processing Dependency: php-common(x86-64) = 7.0.19-1.ius.centos7 for package: php70u-mcrypt-7.0.19-1.ius.centos7.x86_64
--> Processing Dependency: php-common(x86-64) = 7.0.19-1.ius.centos7 for package: php70u-pdo-7.0.19-1.ius.centos7.x86_64
--> Processing Dependency: php-common(x86-64) = 7.0.19-1.ius.centos7 for package: php70u-xml-7.0.19-1.ius.centos7.x86_64
--> Processing Dependency: php-common(x86-64) = 7.0.19-1.ius.centos7 for package: php70u-json-7.0.19-1.ius.centos7.x86_64
---> Package php70u-common.x86_64 0:7.0.20-1.ius.centos7 will be an update
--> Running transaction check
---> Package mod_php70u.x86_64 0:7.0.19-1.ius.centos7 will be updated
---> Package mod_php70u.x86_64 0:7.0.20-1.ius.centos7 will be an update
---> Package php70u-json.x86_64 0:7.0.19-1.ius.centos7 will be updated
---> Package php70u-json.x86_64 0:7.0.20-1.ius.centos7 will be an update
---> Package php70u-mbstring.x86_64 0:7.0.19-1.ius.centos7 will be updated
---> Package php70u-mbstring.x86_64 0:7.0.20-1.ius.centos7 will be an update
---> Package php70u-mcrypt.x86_64 0:7.0.19-1.ius.centos7 will be updated
---> Package php70u-mcrypt.x86_64 0:7.0.20-1.ius.centos7 will be an update
---> Package php70u-pdo.x86_64 0:7.0.19-1.ius.centos7 will be updated
--> Processing Dependency: php-pdo(x86-64) = 7.0.19-1.ius.centos7 for package: php70u-mysqlnd-7.0.19-1.ius.centos7.x86_64
---> Package php70u-pdo.x86_64 0:7.0.20-1.ius.centos7 will be an update
---> Package php70u-xml.x86_64 0:7.0.19-1.ius.centos7 will be updated
---> Package php70u-xml.x86_64 0:7.0.20-1.ius.centos7 will be an update
--> Running transaction check
---> Package php70u-mysqlnd.x86_64 0:7.0.19-1.ius.centos7 will be updated
---> Package php70u-mysqlnd.x86_64 0:7.0.20-1.ius.centos7 will be an update
--> Processing Conflict: php71u-common-7.1.6-1.ius.centos7.x86_64 conflicts php-common < 7.1.6-1.ius.centos7
--> Processing Conflict: php71u-common-7.1.6-1.ius.centos7.x86_64 conflicts php-common < 7.1.6-1.ius.centos7
--> Processing Conflict: php71u-common-7.1.6-1.ius.centos7.x86_64 conflicts php56u-common
--> Processing Conflict: php71u-common-7.1.6-1.ius.centos7.x86_64 conflicts php70u-common
--> Processing Conflict: php70u-common-7.0.20-1.ius.centos7.x86_64 conflicts php-common < 7.0.20
--> Processing Conflict: php70u-common-7.0.20-1.ius.centos7.x86_64 conflicts php56u-common
--> Processing Conflict: php70u-cli-7.0.20-1.ius.centos7.x86_64 conflicts php-cli < 7.0.20
--> Processing Conflict: php70u-json-7.0.20-1.ius.centos7.x86_64 conflicts php-json < 7.0.20
--> Processing Conflict: php70u-mysqlnd-7.0.20-1.ius.centos7.x86_64 conflicts php-mysql < 7.0.20
--> Processing Conflict: php70u-mysqlnd-7.0.20-1.ius.centos7.x86_64 conflicts php-mysqlnd < 7.0.20
--> Processing Conflict: php70u-pdo-7.0.20-1.ius.centos7.x86_64 conflicts php-pdo < 7.0.20
--> Processing Conflict: php70u-xml-7.0.20-1.ius.centos7.x86_64 conflicts php-xml < 7.0.20
--> Finished Dependency Resolution
Error: php71u-common conflicts with php56u-common-5.6.30-2.ius.centos7.x86_64
Error: php70u-xml conflicts with php56u-xml-5.6.30-2.ius.centos7.x86_64
Error: php71u-common conflicts with php70u-common-7.0.20-1.ius.centos7.x86_64
Error: php70u-mysqlnd conflicts with php56u-mysqlnd-5.6.30-2.ius.centos7.x86_64
Error: php70u-cli conflicts with php56u-cli-5.6.30-2.ius.centos7.x86_64
Error: php70u-pdo conflicts with php56u-pdo-5.6.30-2.ius.centos7.x86_64
Error: php70u-common conflicts with php56u-common-5.6.30-2.ius.centos7.x86_64
Error: php70u-json conflicts with php56u-pecl-jsonc-1.3.10-2.ius.centos7.x86_64

尝试使用yum-plugin-replace命令修复

例如:

yum replace php56u-common --replace-with php71u-common

得到这个输出:

Loaded plugins: fastestmirror, langpacks, replace
Replacing packages takes time, please be patient...
Error: Package 'php56u-common' is not installed.

也尝试过(根据此链接)

yum replace php-common --replace-with php71u-common

并得到这个输出:

Loaded plugins: fastestmirror, langpacks, replace
Replacing packages takes time, please be patient...
Error: Package 'php-common' is not installed

我注意到这些 php56 软件包在执行 a 时没有安装yum list installed,但在执行 a 时确实出现了yum list available

任何有关如何解决此问题的见解都将受到赞赏。

答案1

尝试这个:

删除所有 PHP 包

yum remove php*

安装 PHP 7.1 软件包:

yum install php71u php71u-cli php71u-common php71u-gd php71u-mbstring php71u-mysqlnd php71u-pdo php71u-xml php71u-json

大功告成,现在检查版本php -v

相关内容