如何在 CentOS 6.3 x64 下安装 php-devel?

如何在 CentOS 6.3 x64 下安装 php-devel?

我正在尝试在我的 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(针对量子):这里是“yum 重新排序“:

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 repo 后编辑 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]#

答案1

您似乎正在尝试从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,尽管您似乎已经拥有它了。

答案2

检查yum.conf是否存在排除参数,例如:

exclude=apache* httpd* mod_* mysql* MySQL* da_* *ftp* exim* sendmail* bind-chroot*

例如,当使用 DirectAdmin 或其他控制面板应用程序时,有时会默认设置此功能。

答案3

我已经向我的 VPS 提供商和 cPanel 开具了一张票。目前没有更新。上面的答案被接受,因为这是正常的做法。我的服务器简直疯了 :)

答案4

您需要重新编译 cpanel/scripts/easyapache以启用额外的模块/扩展。

相关内容