无法在CentOS上安装PHP软件包 [英] Can't install PHP Package on CentOS

查看:826
本文介绍了无法在CentOS上安装PHP软件包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法通过yum在我的数字海洋托管的服务器上重新安装PHP。

I am having trouble re-installing PHP via yum on my server hosted by digital ocean.

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

I had PHP 5.4 installed but wanted 5.6. I added/enabled the remi repo's, ran yum -y remove php* and then tried to re-install php.

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

When I run yum -y install php I get the following:

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

我一直在关注本教程

我有点卡住了。我已经尝试删除httpd,重新安装httpd,没有什么似乎解决这个问题。我甚至得到的错误,当我禁用remi,并尝试和安装PHP 5.4。

I'm a bit stuck. I have tried removing httpd, re-installing httpd, nothing seems to fix this. I even get the error when I disable remi and try and install PHP 5.4.

有什么想法从哪里去?

我正在运行CentOS Linux 7.1.1503版(Core)

I am running CentOS Linux release 7.1.1503 (Core)

推荐答案

问题是,我安装了错误的EL版本。
我删除了所有我的额外的仓库,删除所有php包,删除httpd。
经过以下操作:

I fixed it! The issue was that I had the wrong version of EL installed. I removed all my extra repo's, removed all php packages, removed httpd. Ran the following:

yum install epel-release
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum clean
yum update


$ b b

然后我可以使用以下

I was then able to install PHP using the following

yum install php56w php56w-opcache php56w-mcrypt php56w-pdo php56w-mysql

这篇关于无法在CentOS上安装PHP软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆