Installation

CentOS 6.3 x64下如何安裝php-devel?

  • May 27, 2015

我正在嘗試在我的 CentOS 6.3 VPS 上安裝 php-devel 並獲得失敗的依賴項測試。來自 phpinfos():SYSTEM Linux 2.6.32-279.5.2.el6.x86_64 #1 x86_64 NTS

錯誤:失敗的依賴項:

  • php-devel-5.4.6-1.el6.remi.x86_64 需要 php(x86-64) = 5.4.6-1.el6.remi

我嘗試了以下 RPM 包:

  • php54w-devel-5.4.6-1.w6.x86_64.rpm
  • php-devel-5.4.6-1.el6.remi.i686.rpm
  • php-devel-5.4.6-1.el6.remi.x86_64.rpm

上面的一個包給了我這個:

root@sv1 [/tmp]# rpm -Uvh php-devel-5.4.6-1.el6.remi.i686.rpm
warning: php-devel-5.4.6-1.el6.remi.i686.rpm: Header V3 DSA/SHA1 Signature, key ID 00f97f56: NOKEY
error: Failed dependencies:
       php(x86-32) = 5.4.6-1.el6.remi is needed by php-devel-5.4.6-1.el6.remi.i686
       libbz2.so.1 is needed by php-devel-5.4.6-1.el6.remi.i686
       libcom_err.so.2 is needed by php-devel-5.4.6-1.el6.remi.i686
       libcrypto.so.10 is needed by php-devel-5.4.6-1.el6.remi.i686
       libedit.so.0 is needed by php-devel-5.4.6-1.el6.remi.i686
       libgmp.so.3 is needed by php-devel-5.4.6-1.el6.remi.i686
       libgssapi_krb5.so.2 is needed by php-devel-5.4.6-1.el6.remi.i686
       libk5crypto.so.3 is needed by php-devel-5.4.6-1.el6.remi.i686
       libkrb5.so.3 is needed by php-devel-5.4.6-1.el6.remi.i686
       libncurses.so.5 is needed by php-devel-5.4.6-1.el6.remi.i686
       libssl.so.10 is needed by php-devel-5.4.6-1.el6.remi.i686
       libstdc++.so.6 is needed by php-devel-5.4.6-1.el6.remi.i686
       libxml2.so.2 is needed by php-devel-5.4.6-1.el6.remi.i686
       libxml2.so.2(LIBXML2_2.4.30) is needed by php-devel-5.4.6-1.el6.remi.i686
       libxml2.so.2(LIBXML2_2.5.2) is needed by php-devel-5.4.6-1.el6.remi.i686
       libxml2.so.2(LIBXML2_2.6.0) is needed by php-devel-5.4.6-1.el6.remi.i686
       libxml2.so.2(LIBXML2_2.6.11) is needed by php-devel-5.4.6-1.el6.remi.i686
       libxml2.so.2(LIBXML2_2.6.5) is needed by php-devel-5.4.6-1.el6.remi.i686
       libz.so.1 is needed by php-devel-5.4.6-1.el6.remi.i686

我不知道如何修復此錯誤並下載所有依賴項。謝謝你。

編輯 1(對於 quanta):這是“ yum repolist ”:

root@sv1 [/tmp]# yum repolist
Loaded plugins: fastestmirror, presto
Loading mirror speeds from cached hostfile
* base: mirror.atlanticmetro.net
* epel: mirror.cogentco.com
* extras: mirror.atlanticmetro.net
* rpmforge: mirror.us.leaseweb.net
* updates: centos.mirror.choopa.net
repo id                          repo name                                                              status
base                             CentOS-6 - Base                                                          5,980+366
epel                             Extra Packages for Enterprise Linux 6 - x86_64                         6,493+1,272
extras                           CentOS-6 - Extras                                                                4
rpmforge                         RHEL 6 - RPMforge.net - dag                                            2,123+2,310
updates                          CentOS-6 - Updates                                                          499+29
repolist: 15,099
root@sv1 [/tmp]#

rpm -qa | grep php沒有返回任何結果。我忘了提到我正在使用 cPanel/WHM

添加 Remi 儲存庫後編輯 2:

>root@sv1 [/etc/yum.repos.d]# yum clean all
Loaded plugins: fastestmirror, presto
Cleaning repos: base epel extras remi remi-test rpmforge updates
Cleaning up Everything
Cleaning up list of fastest mirrors
1 delta-package files removed, by presto

>root@sv1 [/etc/yum.repos.d]# yum repolist
Loaded plugins: fastestmirror, presto
Determining fastest mirrors
epel/metalink                                                                                |  12 kB     00:00
* base: centos.mirror.nac.net
* epel: mirror.symnds.com
* extras: centos.mirror.choopa.net
* remi: remi-mirror.dedipower.com
* remi-test: remi-mirror.dedipower.com
* rpmforge: mirror.us.leaseweb.net
* updates: centos.mirror.nac.net
base                                                                                         | 3.7 kB     00:00
base/primary_db                                                                              | 4.5 MB     00:00
epel                                                                                         | 4.3 kB     00:00
epel/primary_db                                                                              | 4.7 MB     00:00
extras                                                                                       | 3.0 kB     00:00
extras/primary_db                                                                            | 6.3 kB     00:00
remi                                                                                         | 2.9 kB     00:00
remi/primary_db                                                                              | 330 kB     00:00
remi-test                                                                                    | 2.9 kB     00:00
remi-test/primary_db                                                                         |  85 kB     00:00
rpmforge                                                                                     | 1.9 kB     00:00
rpmforge/primary_db                                                                          | 2.5 MB     00:00
updates                                                                                      | 3.5 kB     00:00
updates/primary_db                                                                           | 2.3 MB     00:00
repo id                      repo name                                                                   status
base                         CentOS-6 - Base                                                               5,980+366
epel                         Extra Packages for Enterprise Linux 6 - x86_64                              6,493+1,272
extras                       CentOS-6 - Extras                                                                     4
remi                         Les RPM de remi pour Enterprise Linux 6 - x86_64                                 96+564
remi-test                    Les RPM de remi en test pour Enterprise Linux 6 - x86_64                         25+139
rpmforge                     RHEL 6 - RPMforge.net - dag                                                 2,123+2,310
updates                      CentOS-6 - Updates                                                               499+29
repolist: 15,220

>root@sv1 [/etc/yum.repos.d]# yum install php-devel
Loaded plugins: fastestmirror, presto
Loading mirror speeds from cached hostfile
* base: centos.mirror.nac.net
* epel: mirror.symnds.com
* extras: centos.mirror.choopa.net
* remi: remi-mirror.dedipower.com
* remi-test: remi-mirror.dedipower.com
* rpmforge: mirror.us.leaseweb.net
* updates: centos.mirror.nac.net
Setting up Install Process
No package php-devel available.
Error: Nothing to do

>root@sv1 [/etc/yum.repos.d]#

您似乎正在嘗試從remi儲存庫(以及remi-testPHP 5.4)安裝軟體包,但儲存庫未啟用或不存在於您的系統上。

如果您尚未安裝 remi 儲存庫,請現在通過安裝適當的 remi-release 包來安裝。

然後,您需要編輯/etc/yum.repos.d/remi.repo並更改enabled=0enabled=1您希望使用的儲存庫。對於 EL 6 上的 PHP 5.4,您必須同時啟用remiremi-test

您還需要安裝 EPEL 儲存庫才能使用 remi,儘管您似乎已經有了那個。

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