Php

在 CentOS 6 上安裝 php-devel 時遇到問題

  • August 7, 2012

我正在嘗試在 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,但我不確定如何更改它。

看起來像是php-5.3.15-1.el6.remi.x86_64remirepo 安裝的,但該 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

引用自:https://serverfault.com/questions/415141