問題描述
我們有 CentOS 的 VPS.我已經使用以下命令安裝了 SOAP:
We have VPS with CentOS. I have installed SOAp using the following command:
$ 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
然后我通過運行重新啟動服務器
Then I restarted the server by running
$ service httpd restart
但 SOAP 仍未啟用.我收到 Fatal error: Class 'SoapClient'
消息.
如果我再次嘗試安裝它,我會收到以下消息:
If I try to install it again, I get following message:
Package php-soap-5.3.3-27.el6_5.x86_64 already installed and latest version
我也嘗試使用以下命令重新配置 PHP:
I tried to reconfigure PHP with following command as well:
$ 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'
有什么幫助嗎?
推薦答案
就我的觀點而言,首先要在 Centos 中安裝soap
For my point of view, First thing is to install soap into Centos
yum install php-soap
二、查看soap包是否存在
Second, see if the soap package exist or not
yum search php-soap
第三,因此您必須看到您安裝的soap包的一些結果,現在在根文件夾中的終端中鍵入命令以搜索特定路徑的soap位置
third, thus you must see some result of soap package you installed, now type a command in your terminal in the root folder for searching the location of soap for specific path
find -name soap.so
第四,你會看到它安裝/定位的確切路徑,只需復制路徑并找到php.ini添加擴展路徑,
fourth, you will see the exact path where its installed/located, simply copy the path and find the php.ini to add the extension path,
通常centos 6中php.ini文件的路徑在
usually the path of php.ini file in centos 6 is in
/etc/php.ini
第五,從下面添加一行代碼到php.ini文件中
fifth, add a line of code from below into php.ini file
extension='/usr/lib/php/modules/soap.so'
然后保存文件并退出.
第六次在Centos中運行apache restart命令.我認為有兩個命令可以重啟你的 apache(以你更容易的為準)
sixth run apache restart command in Centos. I think there is two command that can restart your apache ( whichever is easier for you )
service httpd restart
或
apachectl restart
最后,檢查瀏覽器中的 phpinfo() 輸出,您應該看到 SOAP 部分,其中列出了 SOAP CLIENT、SOAP SERVER 等并顯示為已啟用.
Lastly, check phpinfo() output in browser, you should see SOAP section where SOAP CLIENT, SOAP SERVER etc are listed and shown Enabled.
這篇關于如何在 CentOS 上啟用 SOAP的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!