我要安装的脚本需要 mysqli 扩展或 PDO 和 pdo_mysql 扩展。
运行带有 Nginx 的 Centos 7 的 VPS。
PHP 安装:
rpm -qa | grep php
php70w-fpm-7.0.17-1.w7.x86_64
php70w-opcache-7.0.17-1.w7.x86_64
php70w-common-7.0.17-1.w7.x86_64
当尝试安装 php-mysqli 时,我收到以下输出:
yum install php-mysqli
Loaded plugins: fastestmirror, priorities, replace
Loading mirror speeds from cached hostfile
* base: mirror.softaculous.com
* epel: fr2.rpmfind.net
* extras: ftp.halifax.rwth-aachen.de
* updates: ftp.plusline.de
* webtatic: sp.repo.webtatic.com
Resolving Dependencies
--> Running transaction check
---> Package php71w-mysql.x86_64 0:7.1.3-1.w7 will be installed
--> Processing Dependency: php71w-pdo(x86-64) for package: php71w-mysql-7.1.3-1.w7.x86_64
--> Running transaction check
---> Package php71w-pdo.x86_64 0:7.1.3-1.w7 will be installed
--> Processing Dependency: php71w-common(x86-64) = 7.1.3-1.w7 for package: php71w-pdo-7.1.3-1.w7.x86_64
--> Running transaction check
---> Package php71w-common.x86_64 0:7.1.3-1.w7 will be installed
--> Processing Conflict: php71w-common-7.1.3-1.w7.x86_64 conflicts php-common < 7.1
--> Finished Dependency Resolution
Error: php71w-common conflicts with php70w-common-7.0.17-1.w7.x86_64
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
所以在我看来 php71w-common 和 php70w-common 之间存在冲突。
Php71w 已安装但未使用。
我尝试安装其他东西并收到类似的错误,这次是使用 php-common-5.4.16:
yum install php-devel php-pear mysql-devel httpd-devel
Processing Conflict: php70w-common-7.0.17-1.w7.x86_64 conflicts php-common < 7.0
Error: php70w-common conflicts with php-common-5.4.16-42.el7.x86_64
我对 unix 和 php 还很陌生,所以如果我的问题很愚蠢,请原谅我。
我该怎么做才能使 mysqli 扩展或 PDO、pdo_mysql 扩展正常工作,是否有一种简单的方法可以删除 php 5.4.16 和 php 7.1,以避免将来出现此类冲突。
非常感谢您的帮助!