在Centos 7.8上安装php 7.4的软件包错误问题

时间:2020-11-11 18:11:42

标签: php centos7 php-7

我在使用Centos 7.8和PHP7时遇到了问题,我经历了Stack Overlfow并找到了一些类似的帖子,但没有得到我问题的答案。我有php 5.6,当我尝试安装php 74时,出现以下错误。我尝试安装必需文件,但是它抛出另一个错误,说它需要相同的文件。

错误:

Package: php-mcrypt-7.1.33-10.el7.remi.x86_64 (remi-php71)
           Requires: php-common(x86-64) = 7.1.33-10.el7.remi
           Removing: php-common-5.6.40-23.el7.remi.x86_64 (@remi-php56)
               php-common(x86-64) = 5.6.40-23.el7.remi
           Updated By: php-common-7.4.12-1.el7.remi.x86_64 (remi-php74)
               php-common(x86-64) = 7.4.12-1.el7.remi
           Available: php-common-5.4.16-48.el7.x86_64 (base)
               php-common(x86-64) = 5.4.16-48.el7
           Available: php-common-5.4.45-18.el7.remi.x86_64 (remi)
               php-common(x86-64) = 5.4.45-18.el7.remi
           Available: php-common-5.6.40-22.el7.remi.x86_64 (remi-php56)
               php-common(x86-64) = 5.6.40-22.el7.remi
           Available: php-common-7.1.33-9.el7.remi.x86_64 (remi-php71)
               php-common(x86-64) = 7.1.33-9.el7.remi
           Available: php-common-7.1.33-10.el7.remi.x86_64 (remi-php71)
               php-common(x86-64) = 7.1.33-10.el7.remi
           Available: php-common-7.2.33-1.el7.remi.x86_64 (remi-php72)
               php-common(x86-64) = 7.2.33-1.el7.remi
           Available: php-common-7.2.34-1.el7.remi.x86_64 (remi-php72)
               php-common(x86-64) = 7.2.34-1.el7.remi
           Available: php-common-7.3.23-1.el7.remi.x86_64 (remi-php73)
               php-common(x86-64) = 7.3.23-1.el7.remi
           Available: php-common-7.3.24-1.el7.remi.x86_64 (remi-php73)
               php-common(x86-64) = 7.3.24-1.el7.remi
           Available: php-common-7.4.11-1.el7.remi.x86_64 (remi-php74)
               php-common(x86-64) = 7.4.11-1.el7.remi
Error: Package: php-recode-7.3.24-1.el7.remi.x86_64 (remi-php73)
           Requires: php-common(x86-64) = 7.3.24-1.el7.remi
           Removing: php-common-5.6.40-23.el7.remi.x86_64 (@remi-php56)
               php-common(x86-64) = 5.6.40-23.el7.remi
           Updated By: php-common-7.4.12-1.el7.remi.x86_64 (remi-php74)
               php-common(x86-64) = 7.4.12-1.el7.remi
           Available: php-common-5.4.16-48.el7.x86_64 (base)
               php-common(x86-64) = 5.4.16-48.el7
           Available: php-common-5.4.45-18.el7.remi.x86_64 (remi)
               php-common(x86-64) = 5.4.45-18.el7.remi
           Available: php-common-5.6.40-22.el7.remi.x86_64 (remi-php56)
               php-common(x86-64) = 5.6.40-22.el7.remi
           Available: php-common-7.1.33-9.el7.remi.x86_64 (remi-php71)
               php-common(x86-64) = 7.1.33-9.el7.remi
           Available: php-common-7.1.33-10.el7.remi.x86_64 (remi-php71)
               php-common(x86-64) = 7.1.33-10.el7.remi
           Available: php-common-7.2.33-1.el7.remi.x86_64 (remi-php72)
               php-common(x86-64) = 7.2.33-1.el7.remi
           Available: php-common-7.2.34-1.el7.remi.x86_64 (remi-php72)
               php-common(x86-64) = 7.2.34-1.el7.remi
           Available: php-common-7.3.23-1.el7.remi.x86_64 (remi-php73)
               php-common(x86-64) = 7.3.23-1.el7.remi
           Available: php-common-7.3.24-1.el7.remi.x86_64 (remi-php73)
               php-common(x86-64) = 7.3.24-1.el7.remi
           Available: php-common-7.4.11-1.el7.remi.x86_64 (remi-php74)
               php-common(x86-64) = 7.4.11-1.el7.remi

1 个答案:

答案 0 :(得分:0)

似乎您启用了各种php存储库(remi-php71,remi-php72 ...),只是保留了您想要的那个

wizard

所述
yum-config-manager --disable 'remi-php*'
yum-config-manager --enable   remi-php74

包装:php-mcrypt-7.1.33-10.el7.remi.x86_64(remi-php71)

mcrypt扩展名已弃用,并已从 PHP 7.2

中删除

另请参阅:About libmcrypt and php-mcrypt

错误:软件包:php-recode-7.3.24-1.el7.remi.x86_64(remi-php73)

recode扩展名已弃用,并已从 PHP 7.4

中删除

因此,您必须在升级之前删除这些扩展名,并且如果您“确实”需要它们,则无法升级。

yum remove php-recode php-mcrypt

注意:php-pecl-mcrypt和php-pecl-recode可用于旧版应用程序,但不建议使用,不予支持。