升级 mysql 后,我在 centos 6.1 服务器上安装 mysqli 时遇到问题。
这是我运行后得到的结果yum list installed | grep -i mysql
:
mysql.x86_64 5.1.73-8.el6_8 @base
mysql-libs.x86_64 5.1.73-8.el6_8 @base
mysql-server.x86_64 5.1.73-8.el6_8 @base
perl-DBD-MySQL.x86_64 4.013-3.el6 @base
以下是运行后的结果yum install php-mysqli
Loaded plugins: fastestmirror, replace, security
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: centos.mirror.iweb.ca
* epel: mirror.compevo.com
* extras: centos.mirror.globo.tech
* remi-safe: mirror.23media.de
* updates: centos.mirror.colo-serv.net
* webtatic: us-east.repo.webtatic.com
Resolving Dependencies
--> Running transaction check
---> Package php-mysql.x86_64 0:5.3.3-49.el6 will be installed
--> Processing Dependency: php-common(x86-64) = 5.3.3-49.el6 for package: php-mysql-5.3.3-49.el6.x86_64
--> Finished Dependency Resolution
Error: Package: php-mysql-5.3.3-49.el6.x86_64 (base)
Requires: php-common(x86-64) = 5.3.3-49.el6
Installed: php-common-5.4.45-1.el6.remi.x86_64 (@remi)
php-common(x86-64) = 5.4.45-1.el6.remi
Available: php-common-5.3.3-49.el6.x86_64 (base)
php-common(x86-64) = 5.3.3-49.el6
Available: php55w-common-5.5.38-1.w6.x86_64 (webtatic)
php-common(x86-64) = 5.5.38-1.w6
Available: php56w-common-5.6.40-1.w6.x86_64 (webtatic)
php-common(x86-64) = 5.6.40-1.w6
Available: php70w-common-7.0.33-1.w6.x86_64 (webtatic)
php-common(x86-64) = 7.0.33-1.w6
Available: php71w-common-7.1.26-1.w6.x86_64 (webtatic)
php-common(x86-64) = 7.1.26-1.w6
Available: php71w-common-7.1.27-1.w6.x86_64 (webtatic)
php-common(x86-64) = 7.1.27-1.w6
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
我似乎遇到了版本问题,但我对服务器问题不是很了解,因此很难诊断。提前感谢大家的帮助。
答案1
您继承了此服务器吗?看起来有人对 PHP 版本和第三方存储库有点疯狂。
目前您的服务器正在使用来自 remi 存储库的 PHP 5.4,但您已禁用该存储库并启用了 webtatic,但您似乎没有安装任何东西。
启用 remi repo,禁用 webtatic repo,然后重试。
要升级 PHP,请确保remi-release
RPM 已安装,然后您可以选择与您想要的 PHP 版本相对应的其他 remi repo(例如 remi-php55、remi-php56 等)。