我正在尝试在 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
我已经卸载并重新安装了几次,每次都一样。
谁能解释为什么这两种方法都失败了?如果需要,很乐意提供更多详细信息。