在php 5.4.20 Centos 6上安装php soap时出错


Error installing php-soap on PHP 5.4.20 Centos 6

我正在尝试在我的Centos 6.6上安装php-soap。我运行的是PHP 5.4.20。当我执行"yum-install php-soap"时,我会收到以下错误:

Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: centos.openitc.uk
* epel: epel.check-update.co.uk
* extras: centos.openitc.uk
* rpmforge: mirror.nl.leaseweb.net
* updates: centos.openitc.uk
* webtatic: us-east.repo.webtatic.com
Resolving Dependencies
--> Running transaction check
---> Package php-soap.x86_64 0:5.3.3-40.el6_6 will be installed
--> Processing Dependency: php-common(x86-64) = 5.3.3-40.el6_6 for package: php-soap-5.3.3-40.el6_6.x86_64
--> Finished Dependency Resolution
Error: Package: php-soap-5.3.3-40.el6_6.x86_64 (updates)
       Requires: php-common(x86-64) = 5.3.3-40.el6_6
       Installed: php-common-5.4.20-1.el6.remi.x86_64 (@remi)
           php-common(x86-64) = 5.4.20-1.el6.remi
       Available: php-common-5.3.3-38.el6.x86_64 (base)
           php-common(x86-64) = 5.3.3-38.el6
       Available: php-common-5.3.3-40.el6_6.x86_64 (updates)
           php-common(x86-64) = 5.3.3-40.el6_6
       Available: php54w-common-5.4.36-1.w6.x86_64 (webtatic)
           php-common(x86-64) = 5.4.36-1.w6
       Available: php54w-common-5.4.37-1.w6.x86_64 (webtatic)
           php-common(x86-64) = 5.4.37-1.w6
       Available: php54w-common-5.4.38-1.w6.x86_64 (webtatic)
           php-common(x86-64) = 5.4.38-1.w6
       Available: php55w-common-5.5.20-1.w6.x86_64 (webtatic)
           php-common(x86-64) = 5.5.20-1.w6
       Available: php55w-common-5.5.21-1.w6.x86_64 (webtatic)
           php-common(x86-64) = 5.5.21-1.w6
       Available: php55w-common-5.5.22-1.w6.x86_64 (webtatic)
           php-common(x86-64) = 5.5.22-1.w6
       Available: php56w-common-5.6.4-1.w6.x86_64 (webtatic)
           php-common(x86-64) = 5.6.4-1.w6
       Available: php56w-common-5.6.5-1.w6.x86_64 (webtatic)
           php-common(x86-64) = 5.6.5-1.w6
       Available: php56w-common-5.6.6-1.w6.x86_64 (webtatic)
           php-common(x86-64) = 5.6.6-1.w6
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest

我该如何解决它?我安装了以下PHP模块:

php-tcpdf-dejavu-sans-fonts-6.2.4-1.el6.noarch
newrelic-php5-4.18.0.89-1.x86_64
php-cli-5.4.20-1.el6.remi.x86_64
php-mcrypt-5.4.20-1.el6.remi.x86_64
php-gd-5.4.20-1.el6.remi.x86_64
phpMyAdmin-4.0.7-1.el6.remi.noarch
php-pear-1.9.4-4.el6.noarch
php-tcpdf-6.2.4-1.el6.noarch
php-common-5.4.20-1.el6.remi.x86_64
php-mbstring-5.4.20-1.el6.remi.x86_64
php-bcmath-5.4.20-1.el6.remi.x86_64
php-pdo-5.4.20-1.el6.remi.x86_64
php-pecl-memcache-3.0.8-1.el6.remi.x86_64
php-php-gettext-1.0.11-3.el6.noarch
newrelic-php5-common-4.18.0.89-1.noarch
php-xml-5.4.20-1.el6.remi.x86_64
php-mysql-5.4.20-1.el6.remi.x86_64
php-recode-5.4.20-1.el6.remi.x86_64
php-tidy-5.4.20-1.el6.remi.x86_64
php-5.4.20-1.el6.remi.x86_64

删除PHP 5.4并安装PHP 5.3.3是个好主意吗?我不确定我的网站是否可以运行PHP 5.5。

谢谢你的建议!!

我遵循@liquidflo的链接,这样做是为了解决问题。

  • 列出了所有安装的PHP模块,以确保我稍后能取回所有

    rpm-qa|grep-php

我有一个混合的模块,我认为是5.3和5.4。然后我复制了所有模块的名称,并用删除了它们

#sudo yum remove php php-mbstring php-mysql php-cli php-gd ...(list all the modules...

然后我安装了所有删除的php模块。

#sudo yum install php php-mbstring php-mysql php-cli php-gd php-soap ...(list all the modules, added php-soap now)...

我现在回到PHP 5.3.3,PHP soap工作。

尝试下载这个。。

php soap 5.4.16-36 i686

以及强制安装。。

rpm -Uvh php-soap-5.4.16-36.1.el7_2.1.i686.rpm --nodeps

这可能是从remi存储库获取的php版本和soap版本之间的冲突

下面的命令列出了存储库中的可用包

yum list php55-*

这里55是php版本。

...
php55-php-snmp.x86_64                                                    5.5.38-7.el6.remi                                            remi-safe
php55-php-soap.x86_64                                                    5.5.38-7.el6.remi                                            remi-safe
php55-php-suhosin.x86_64                                                 0.9.38-1.el6.remi                                            remi-safe
...

找出相关的包并运行它。

yum install php55-php-soap.x86_64

最后,您必须启用soap模块

find -name soap.so
/opt/remi/php55/root/usr/lib64/php/modules/soap.so

将以下行添加到php.ini文件中

extension='/opt/remi/php55/root/usr/lib64/php/modules/soap.so'

重新启动apache服务器

sudo service httpd restart
   Installed: php-common-5.4.20-1.el6.remi.x86_64 (@remi)

你有来自"remi"存储库的php5.4,所以你需要启用这个存储库来安装额外的扩展(顺便说一句,这意味着更新到最新的5.4.45)

yum --enablerepo=remi install php-soap

您还可以永久启用php5.4存储库(或任何其他版本)

yum-config-manager --enable remi-php54
yum install php-soap

注意:PHP 5.4现在是EOL,并且没有被PHP项目维护,我强烈建议您更新到维护版本(5.6,7,7.1)

请参阅向导说明