无法在 Centos 7 上安装 PHP 7.3

无法在 Centos 7 上安装 PHP 7.3

我有一台服务器,目前运行的是 CentOS 7.6 和 PHP 7.1.25。我想将我的 PHP 版本更新到 7.3(12 月 6 日发布),但遇到了一些麻烦。

我跟着本指南但是当我运行时yum update,它会引发以下错误:

# yum update
Loaded plugins: priorities
4509 packages excluded due to repository priority protections
Resolving Dependencies
--> Running transaction check
---> Package php-mcrypt.x86_64 0:7.1.25-2.el7.remi will be obsoleted
---> Package php-pecl-mcrypt.x86_64 0:1.0.1-8.el7.remi.7.3 will be obsoleting
--> Processing Dependency: php(api) = 20180731-64 for package: php-pecl-mcrypt-1.0.1-8.el7.remi.7.3.x86_64
--> Processing Dependency: php(zend-abi) = 20180731-64 for package: php-pecl-mcrypt-1.0.1-8.el7.remi.7.3.x86_64
--> Finished Dependency Resolution
Error: Package: php-pecl-mcrypt-1.0.1-8.el7.remi.7.3.x86_64 (remi-php73)
           Requires: php(api) = 20180731-64
           Installed: php-common-7.1.25-2.el7.remi.x86_64 (@remi-php71)
               php(api) = 20160303-64
           Available: php-common-5.4.45-15.el7.remi.x86_64 (remi)
               php(api) = 20100412-64
           Available: php-common-5.4.45-16.el7.remi.x86_64 (remi)
               php(api) = 20100412-64
           Available: php-common-7.1.25-1.el7.remi.x86_64 (remi-php71)
               php(api) = 20160303-64
           Available: php56u-common-5.6.37-1.ius.centos7.x86_64 (ius)
               php(api) = 20131106-64
           Available: php56u-common-5.6.38-1.ius.centos7.x86_64 (ius)
               php(api) = 20131106-64
           Available: php70u-common-7.0.31-1.ius.centos7.x86_64 (ius)
               php(api) = 20151012-64
           Available: php70u-common-7.0.32-1.ius.centos7.x86_64 (ius)
               php(api) = 20151012-64
           Available: php71u-common-7.1.22-1.ius.centos7.x86_64 (ius)
               php(api) = 20160303-64
           Available: php71u-common-7.1.23-1.ius.centos7.x86_64 (ius)
               php(api) = 20160303-64
           Available: php71u-common-7.1.24-1.ius.centos7.x86_64 (ius)
               php(api) = 20160303-64
           Available: php72u-common-7.2.10-1.ius.centos7.x86_64 (ius)
               php(api) = 20170718-64
           Available: php72u-common-7.2.11-1.ius.centos7.x86_64 (ius)
               php(api) = 20170718-64
           Available: php72u-common-7.2.12-1.ius.centos7.x86_64 (ius)
               php(api) = 20170718-64
Error: Package: php-pecl-mcrypt-1.0.1-8.el7.remi.7.3.x86_64 (remi-php73)
           Requires: php(zend-abi) = 20180731-64
           Installed: php-common-7.1.25-2.el7.remi.x86_64 (@remi-php71)
               php(zend-abi) = 20160303-64
           Available: php-common-5.4.45-15.el7.remi.x86_64 (remi)
               php(zend-abi) = 20100525-64
           Available: php-common-5.4.45-16.el7.remi.x86_64 (remi)
               php(zend-abi) = 20100525-64
           Available: php-common-7.1.25-1.el7.remi.x86_64 (remi-php71)
               php(zend-abi) = 20160303-64
           Available: php56u-common-5.6.37-1.ius.centos7.x86_64 (ius)
               php(zend-abi) = 20131226-64
           Available: php56u-common-5.6.38-1.ius.centos7.x86_64 (ius)
               php(zend-abi) = 20131226-64
           Available: php70u-common-7.0.31-1.ius.centos7.x86_64 (ius)
               php(zend-abi) = 20151012-64
           Available: php70u-common-7.0.32-1.ius.centos7.x86_64 (ius)
               php(zend-abi) = 20151012-64
           Available: php71u-common-7.1.22-1.ius.centos7.x86_64 (ius)
               php(zend-abi) = 20160303-64
           Available: php71u-common-7.1.23-1.ius.centos7.x86_64 (ius)
               php(zend-abi) = 20160303-64
           Available: php71u-common-7.1.24-1.ius.centos7.x86_64 (ius)
               php(zend-abi) = 20160303-64
           Available: php72u-common-7.2.10-1.ius.centos7.x86_64 (ius)
               php(zend-abi) = 20170718-64
           Available: php72u-common-7.2.11-1.ius.centos7.x86_64 (ius)
               php(zend-abi) = 20170718-64
           Available: php72u-common-7.2.12-1.ius.centos7.x86_64 (ius)
               php(zend-abi) = 20170718-64
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

所以我想,我们手动安装吧php(api) = 20180731-64,于是我谷歌了一下这个包,然后找到了这一页我尝试安装php73-php-common,但出现以下错误:

# yum --enablerepo=remi install php73-php-common
Loaded plugins: priorities
4509 packages excluded due to repository priority protections
Package php73-php-common-7.3.0-1.el7.remi.x86_64 already installed and latest version
Nothing to do

我做错了什么/遗漏了什么?如何将 PHP 7.1 升级到 PHP 7.3?

答案1

答案就在你的输出中

已加载插件:优先级

由于存储库优先级保护,4509 个软件包被排除

因此,您需要修复优先级以确保 remi-php73 存储库比任何其他存储库具有更高的优先级(更低的数字)。

另一种方法是删除优先级插件。

答案2

yum-plugin-replace 对我有用

::例子 ::

转速http://mirror.webtatic.com/yum/el6/latest.rpm

yum -y 安装 yum-plugin-replace

yum -y 替换 phpxxx-common --replace-with=phpyyy-common

相关内容