用yum和pear安装php-soap均失败

我正在尝试在Centos 6.4服务器上安装PHP的SOAP扩展.我对软件包管理器不熟悉,无法从CLI安装软件包并在PHP中对其进行配置.我相当有能力管理php.ini和其他PHP配置文件(soap.ini等).

我尝试使用以下命令安装此文件:

yum install php-soap

但这给了我以下错误:

yum install php-soap
Loaded plugins: downloadonly, fastestmirror
Setting up Install Process
Loading mirror speeds from cached hostfile
drivesrvr                                                                                                                                                                                                |  951 B     00:00     
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.
The program yum-complete-transaction is found in the yum-utils package.
--> 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
--> Running transaction check
---> Package php-common.x86_64 0:5.3.3-40.el6_6 will be installed
--> Processing Conflict: php54-common-5.4.36-1.ius.el6.x86_64 conflicts php-common < 5.4
--> Finished Dependency Resolution
Error: php54-common conflicts with php-common-5.3.3-40.el6_6.x86_64
 You could try using --skip-broken to work around the problem
** Found 1 pre-existing rpmdb problem(s), 'yum check' output follows:
cloud-init-0.7.5-10.el6.centos.2.x86_64 has missing requires of PyYAML

请注意以下问题:

Error: php54-common conflicts with php-common-5.3.3-40.el6_6.x86_64

如果列出所有已安装的与PHP相关的软件包,则会得到以下信息:

yum list installed | grep php
php-php-gettext.noarch             1.0.11-3.el6                       @epel     
php-tcpdf.noarch                   6.1.1-1.el6                        @epel     
php-tcpdf-dejavu-sans-fonts.noarch 6.1.1-1.el6                        @epel     
php54.x86_64                       5.4.36-1.ius.el6                   @ius      
php54-bcmath.x86_64                5.4.36-1.ius.el6                   @ius      
php54-cli.x86_64                   5.4.36-1.ius.el6                   @ius      
php54-common.x86_64                5.4.36-1.ius.el6                   @ius      
php54-devel.x86_64                 5.4.36-1.ius.el6                   @ius      
php54-gd.x86_64                    5.4.36-1.ius.el6                   @ius      
php54-mbstring.x86_64              5.4.36-1.ius.el6                   @ius       
php54-mcrypt.x86_64                5.4.36-1.ius.el6                   @ius      
php54-mysql.x86_64                 5.4.36-1.ius.el6                   @ius      
php54-pdo.x86_64                   5.4.36-1.ius.el6                   @ius      
php54-pear.noarch                  1:1.9.5-2.ius.el6                  @ius      
php54-pecl-apc.x86_64              3.1.13-2.ius.el6                   @ius      
php54-pecl-memcache.x86_64         3.0.8-1.ius.el6                    @ius      
php54-suhosin.x86_64               0.9.37-1.ius.el6                   @ius      
php54-tidy.x86_64                  5.4.36-1.ius.el6                   @ius      
php54-xml.x86_64                   5.4.36-1.ius.el6                   @ius      
phpMyAdmin.noarch                  4.0.10.7-1.el6                     @epel     

我还尝试使用pear安装SOAP扩展:

sudo pear install SOAP-0.13.0

这声称扩展程序已成功安装:

WARNING: "pear/HTTP_Request" is deprecated in favor of "pear/HTTP_Request2"
Did not download optional dependencies: pear/Mail, pear/Mail_Mime, pear/Net_DIME, use --alldeps to download automatically
WARNING: "pear/Net_URL" is deprecated in favor of "pear/Net_URL2"
pear/SOAP can optionally use package "pear/Mail"
pear/SOAP can optionally use package "pear/Mail_Mime"
pear/SOAP can optionally use package "pear/Net_DIME"
downloading SOAP-0.13.0.tgz ...
Starting to download SOAP-0.13.0.tgz (85,945 bytes)
....................done: 85,945 bytes
downloading HTTP_Request-1.4.4.tgz ...
Starting to download HTTP_Request-1.4.4.tgz (17,109 bytes)
...done: 17,109 bytes
downloading Net_URL-1.0.15.tgz ...
Starting to download Net_URL-1.0.15.tgz (6,303 bytes)
...done: 6,303 bytes
downloading Net_Socket-1.0.14.tgz ...
Starting to download Net_Socket-1.0.14.tgz (5,600 bytes)
...done: 5,600 bytes
install ok: channel://pear.php.net/Net_URL-1.0.15
install ok: channel://pear.php.net/Net_Socket-1.0.14
install ok: channel://pear.php.net/HTTP_Request-1.4.4
install ok: channel://pear.php.net/SOAP-0.13.0

但是,尽管在我的php.ini中添加了“ extension = soap.so”行,但是SOAP仍未显示在我的phpinfo()中.从命令行运行’php -v’或’pear info SOAP-0.13.0’时,我还会收到以下错误:

PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/soap.so' - /usr/lib64/php/modules/soap.so: cannot open shared object file: No such file or directory in Unknown on line 0

似乎在’/usr/lib64 / php / modules /’或服务器上的其他任何地方都没有soap.so文件,我已经使用以下命令进行过检查:

cd /
find -name soap.so

我已经卸载并重新安装了两次,每次都相同.

谁能提供任何解释说明为什么这些方法都失败了?如果需要,很乐意提供其他详细信息.

解决方法:

根据@EtanReisner的上述评论,我现在已经能够成功安装SOAP软件包.

问题是我混合了来自EPEL和IUS存储库的PHP软件包.从上面可以看到蜜蜂

yum list installed | grep php

这些PHP软件包大多数都来自IUS存储库,似乎我尝试使用来安装的php-soap软件包

yum install php-soap

是基于EPEL的软件包,因此在php-common文件中突出显示了冲突.根据上面的建议,我已经运行了以下内容

yum list | grep ^php54

结果包含一个更合适的基于IUS的PHP SOAP包:

php54-soap.x86_64                         5.4.36-1.ius.el6              ius   

已经卸载了最初尝试遗留下来的SOAP软件包的任何失败安装,然后运行

百胜安装php54-soap

哪个第一次安装没有任何问题.

对于基于PEAR的软件包管理器为何无法成功安装软件包的问题,​​我没有找到第二部分的解决方案.

上一篇:Nginx的安装


下一篇:《PHP精粹:编写高效PHP代码》——1.6节接口