无法在 CentOS 上安装 PHP 包

无法在 CentOS 上安装 PHP 包

我在由 digital ocean 托管的服务器上通过 yum 重新安装 PHP 时遇到了问题。

我安装了 PHP 5.4,但想要 5.6。我添加/启用了 remi repo,运行yum -y remove php*,然后尝试重新安装 php。

当我运行时,yum -y install php我得到以下信息:

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.centos.webair.com
 * epel: mirrors.coreix.net
 * extras: mirrors.centos.webair.com
 * remi: remi.check-update.co.uk
 * remi-php56: remi.check-update.co.uk
 * updates: mirrors.centos.webair.com
 * webtatic: uk.repo.webtatic.com
Resolving Dependencies
--> Running transaction check
---> Package php.x86_64 0:5.6.8-1.el6.remi will be installed
--> Processing Dependency: php-common(x86-64) = 5.6.8-1.el6.remi for package: php-5.6.8-1.el6.remi.x86_64
--> Processing Dependency: php-cli(x86-64) = 5.6.8-1.el6.remi for package: php-5.6.8-1.el6.remi.x86_64
--> Processing Dependency: httpd-mmn = 20051115 for package: php-5.6.8-1.el6.remi.x86_64
--> Running transaction check
---> Package php.x86_64 0:5.6.8-1.el6.remi will be installed
--> Processing Dependency: httpd-mmn = 20051115 for package: php-5.6.8-1.el6.remi.x86_64
---> Package php-cli.x86_64 0:5.6.8-1.el6.remi will be installed
---> Package php-common.x86_64 0:5.6.8-1.el6.remi will be installed
--> Processing Dependency: php-pecl-zip(x86-64) for package: php-common-5.6.8-1.el6.remi.x86_64
--> Processing Dependency: php-pecl-jsonc(x86-64) for package: php-common-5.6.8-1.el6.remi.x86_64
--> Running transaction check
---> Package php.x86_64 0:5.6.8-1.el6.remi will be installed
--> Processing Dependency: httpd-mmn = 20051115 for package: php-5.6.8-1.el6.remi.x86_64
---> Package php-pecl-jsonc.x86_64 0:1.3.7-1.el6.remi.5.6 will be installed
---> Package php-pecl-zip.x86_64 0:1.12.5-1.el6.remi.5.6 will be installed
--> Finished Dependency Resolution
Error: Package: php-5.6.8-1.el6.remi.x86_64 (remi-php56)
           Requires: httpd-mmn = 20051115
           Installed: httpd-2.4.6-31.el7.centos.x86_64 (@base)
               httpd-mmn = 20120211
               httpd-mmn = 20120211x8664
               httpd-mmn = 20120211-x86-64
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

我一直在关注这个教程:https://www.mojowill.com/geek/howto-install-php-5-4-5-5-or-5-6-on-centos-6-and-centos-7/

我有点不知所措。我尝试删除 httpd,重新安装 httpd,但似乎都无法解决这个问题。我甚至在禁用 remi 并尝试安装 PHP 5.4 时也收到错误。

对于接下来该去哪里,您有什么想法吗?

我正在运行 CentOS Linux 版本 7.1.1503(核心)

我认为这可能是与存储库有关的问题,因为我能够在新服务器上安装 php56 而没有任何问题。

答案1

您正在运行 EL7,但安装了 EL6 的 remi 存储库。请安装正确的存储库并重试。

相关内容