我们使用CentOS操作系统的VPS。我使用以下命令安装了SOAp:
$ yum install php-soap
然后我打开 php.ini
文件,去掉了 SOAP 扩展的注释。但是并没有找到它,所以我加入了下面这行代码:
Then I went to the php.ini
file to uncomment the SOAP extension. It was not there, so I added the following line:
extension=soap.so
然后我通过运行命令重启了服务器
$ service httpd restart
但是SOAP仍未启用。
我收到了Fatal error: Class 'SoapClient'
的错误信息。
如果我尝试重新安装它,我会收到以下消息:
Package php-soap-5.3.3-27.el6_5.x86_64 already installed and latest version
我尝试使用以下命令重新配置PHP: 我尝试使用以下命令重新配置PHP:
$ php-config '--disable-fileinfo' '--disable-pdo' '--enable-bcmath' '--enable-calendar' '--enable-ftp' '--enable-libxml' '--enable-sockets' '--prefix=/usr/local' '--with-apxs2=/usr/local/apache/bin/apxs' '--with-curl=/opt/curlssl/' '--with-imap=/opt/php_with_imap_client/' '--with-imap-ssl=/usr' '--with-kerberos' '--with-libdir=lib64' '--with-libxml-dir=/opt/xml2/' '--with-mysql=/usr' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-openssl=/usr' '--with-openssl-dir=/usr' '--with-pcre-regex=/opt/pcre' '--with-pic' '--with-zlib' '--with-zlib-dir=/usr' '--enable-soap'
需要帮忙吗?
sudo systemctl restart php-fpm
。 - Heath Raftery