我正在尝试在 CentosOS 6 上安装用于 PHP 的 mongo 驱动程序。运行“pecl install mongo”时提示“需要 php-devel 包”。
运行“yum install php-devel”出现以下错误:
Loaded plugins: fastestmirror, presto, priorities
Loading mirror speeds from cached hostfile
* base: mirrors.usc.edu
* epel: mirrors.xmission.com
* extras: centos.sonn.com
* updates: mirror.hmc.edu
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-devel.x86_64 0:5.3.3-14.el6_3 will be installed
--> Processing Dependency: php = 5.3.3-14.el6_3 for package: php-devel-5.3.3-14.el6_3.x86_64
--> Processing Dependency: automake for package: php-devel-5.3.3-14.el6_3.x86_64
--> Processing Dependency: autoconf for package: php-devel-5.3.3-14.el6_3.x86_64
--> Running transaction check
---> Package autoconf.noarch 0:2.63-5.1.el6 will be installed
---> Package automake.noarch 0:1.11.1-1.2.el6 will be installed
---> Package php-devel.x86_64 0:5.3.3-14.el6_3 will be installed
--> Processing Dependency: php = 5.3.3-14.el6_3 for package: php-devel-5.3.3-14.el6_3.x86_64
--> Finished Dependency Resolution
Error: Package: php-devel-5.3.3-14.el6_3.x86_64 (updates)
Requires: php = 5.3.3-14.el6_3
Installed: php-5.3.15-1.el6.remi.x86_64 (@remi)
php = 5.3.15-1.el6.remi
Available: php-5.3.3-3.el6_2.8.x86_64 (base)
php = 5.3.3-3.el6_2.8
Available: php-5.3.3-14.el6_3.x86_64 (updates)
php = 5.3.3-14.el6_3
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
有什么建议吗?它似乎正在尝试为 5.3.3-14 而不是 5.3.3-15 安装 devel,但我不确定如何更改它。
答案1
它看起来像是php-5.3.15-1.el6.remi.x86_64
从 repo 安装的remi
,但是该 repo 不再可用或已启用。
首先尝试一下:
yum --enablerepo=remi install php-devel
如果您信任第三方存储库,您应该能够按照以下步骤启用它:
wget http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
sudo rpm -Uvh remi-release-6*.rpm epel-release-6*.rpm
sudo vim /etc/yum.repos.d/remi.repo
-> enabled=1
看http://www.rackspace.com/knowledge_center/article/installing-rhel-epel-repo-on-centos-5x-or-6x更多细节。
答案2
看起来您已从 REMI 存储库升级 PHP 至 5.3.15
Installed: php-5.3.15-1.el6.remi.x86_64 (@remi)
但是,您似乎已经从 yum 存储库中删除了 REMI 存储库,因为我没有在列表中看到任何 remi 镜像。您当前启用的存储库没有可用的正确版本的 php-devel。您需要重新添加 REMI 存储库,然后从那里安装与您当前安装的 PHP 版本匹配的 php-devel 版本。对于您来说,您需要 php-devel-5.3.15。
REMI 安装说明: http://blog.famillecollet.com/pages/Config-en
其他 CentOS 存储库: http://wiki.centos.org/AdditionalResources/Repositories/