Alternative-Php-Cache

嘗試為 php 安裝 apc 擴展時缺少依賴項問題

  • January 4, 2012

我正在嘗試根據本教程為 php 安裝 apc 擴展:http: //2bits.com/articles/installing-php-apc-gnulinux-centos-5.html但無法成功執行第一個命令。這是我得到的:

Loaded plugins: fastestmirror
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository contrib is listed more than once in the configuration
Determining fastest mirrors
Plesk                                                    |  951 B     00:00
Plesk-Third-Party                                        |  951 B     00:00
base                                                     | 1.1 kB     00:00
extras                                                   | 2.1 kB     00:00
updates                                                  | 1.9 kB     00:00
Excluding Packages in global exclude list
Finished
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package php-pear.noarch 1:1.4.9-6.el5 set to be updated
--> Processing Dependency: php-devel for package: php-pear
--> Running transaction check
---> Package php-devel.x86_64 0:5.1.6-27.el5_5.3 set to be updated
--> Processing Dependency: php = 5.1.6-27.el5_5.3 for package: php-devel
--> Processing Dependency: autoconf for package: php-devel
--> Processing Dependency: automake for package: php-devel
--> Running transaction check
---> Package autoconf.noarch 0:2.59-12 set to be updated
--> Processing Dependency: imake for package: autoconf
---> Package automake.noarch 0:1.9.6-2.3.el5 set to be updated
---> Package php-devel.x86_64 0:5.1.6-27.el5_5.3 set to be updated
--> Processing Dependency: php = 5.1.6-27.el5_5.3 for package: php-devel
--> Running transaction check
---> Package imake.x86_64 0:1.0.2-3 set to be updated
---> Package php-devel.x86_64 0:5.1.6-27.el5_5.3 set to be updated
--> Processing Dependency: php = 5.1.6-27.el5_5.3 for package: php-devel
--> Finished Dependency Resolution
php-devel-5.1.6-27.el5_5.3.x86_64 from base has depsolving problems
 --> Missing Dependency: php = 5.1.6-27.el5_5.3 is needed by package php-devel-5.1.6-27.el5_5.3.x86_64 (base)
Error: Missing Dependency: php = 5.1.6-27.el5_5.3 is needed by package php-devel-5.1.6-27.el5_5.3.x86_64 (base)
You could try using --skip-broken to work around the problem
You could try running: package-cleanup --problems
                       package-cleanup --dupes
                       rpm -Va --nofiles --nodigest
The program package-cleanup is found in the yum-utils package.

有誰知道這兩個錯誤是什麼意思,我應該如何解決?

php-devel-5.1.6-27.el5_5.3.x86_64 from base has depsolving problems
 --> Missing Dependency: php = 5.1.6-27.el5_5.3 is needed by package php-devel-5.1.6-27.el5_5.3.x86_64 (base)
Error: Missing Dependency: php = 5.1.6-27.el5_5.3 is needed by package php-devel-5.1.6-27.el5_5.3.x86_64 (base)

我認為這就是我無法在我的伺服器上安裝 apc 的原因。伺服器執行 centos 5.6,php 5.3.8。控制面板是 plesk 10。

你是如何安裝 php-5.3.8 的?php-devel 包的版本必須與您安裝的 php 匹配。先安裝對應的php-devel,再安裝php-pear再試。不過,我不知道該軟體包是否會尋找特定版本的 php。如果是這樣,您需要找到適合版本的 php-pear 包。

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