問題描述
這就是問題所在.我在 Apache 上安裝了 PHP 5.2.9,但無法升級 PHP.有沒有辦法讓我在 PHP 5.2.9 中啟用 SOAP?PHP 手冊在說要啟用 SOAP 支持,請使用 --enable-soap 配置 PHP"時根本沒有幫助.如何配置?
That's much the question. I have PHP 5.2.9 on Apache and I cannot upgrade PHP. Is there a way for me to enable SOAP in PHP 5.2.9? The PHP manual did not help at all when it said, "To enable SOAP support, configure PHP with --enable-soap ." How do I configure?
推薦答案
讓 SOAP 正常工作通常不需要從源代碼編譯 PHP.我建議僅將其作為最后的選擇.
Getting SOAP working usually does not require compiling PHP from source. I would recommend trying that only as a last option.
為了更好的衡量,請檢查您的 phpinfo 對 SOAP 擴展的說明(如果有的話):
For good measure, check to see what your phpinfo says, if anything, about SOAP extensions:
$ php -i | grep -i soap
確保缺少的是 PHP 擴展.
to ensure that it is the PHP extension that is missing.
假設您在 phpinfo 中沒有看到有關 SOAP 的任何信息,請查看您可以使用哪些 PHP SOAP 包.
Assuming you do not see anything about SOAP in the phpinfo, see what PHP SOAP packages might be available to you.
在 Ubuntu/Debian 中,您可以搜索:
In Ubuntu/Debian you can search with:
$ apt-cache search php | grep -i soap
或者在 RHEL/Fedora 中你可以搜索:
or in RHEL/Fedora you can search with:
$ yum search php | grep -i soap
通常有兩個 PHP SOAP 包可供您使用,通常是 php-soap
和 php-nusoap
.php-soap
通常是您使用 --enable-soap
配置 PHP 所得到的.
There are usually two PHP SOAP packages available to you, usually php-soap
and php-nusoap
. php-soap
is typically what you get with configuring PHP with --enable-soap
.
在 Ubuntu/Debian 中,您可以安裝:
In Ubuntu/Debian you can install with:
$ sudo apt-get install php-soap
或者在 RHEL/Fedora 中你可以安裝:
Or in RHEL/Fedora you can install with:
$ sudo yum install php-soap
安裝后,您可能需要放置一個ini文件并重新啟動Apache.
After the installation, you might need to place an ini file and restart Apache.
這篇關于如何在 linux 上的 php 中啟用 --enable-soap?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!