在 CentOS 6.6 伺服器上啟用 PHP 的 SOAP

在 CentOS 6.6 伺服器上啟用 PHP 的 SOAP

我正在嘗試在我的伺服器上啟用 SOAP。 Soap 已安裝,但未顯示在 php_info 中。

PHP 版本 5.4.39

系統資訊:Linux ip-xxx-xxx-xxx-xxx.secureserver.net 2.6.32-042stab106.4 #1 SMP 3 月 27 日星期五 15:19:28 MSK 2015 x86_64

配置命令:

 './configure' '--disable-fileinfo' '--enable-bcmath' '--enable-calendar' '--enable-ftp' '--enable-gd-native-ttf' '--enable-libxml' '--enable-pdo=shared' '--enable-sockets' '--prefix=/usr/local' '--with-apxs2=/usr/local/apache/bin/apxs' '--with-curl=/opt/curlssl/' '--with-freetype-dir=/usr' '--with-gd' '--with-imap=/opt/php_with_imap_client/' '--with-imap-ssl=/usr' '--with-jpeg-dir=/usr' '--with-kerberos' '--with-libdir=lib64' '--with-libxml-dir=/opt/xml2/' '--with-mcrypt=/opt/libmcrypt/' '--with-mysql=/usr' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-openssl=/usr' '--with-openssl-dir=/usr' '--with-pcre-regex=/opt/pcre' '--with-pdo-mysql=shared' '--with-pdo-sqlite=shared' '--with-pic' '--with-png-dir=/usr' '--with-xpm-dir=/usr' '--with-zlib' '--with-zlib-dir=/usr' 

載入的設定檔:/usr/local/lib/php.ini

其中包含:[肥皂]

;extension=soap.so
; Enable soap extension module
extension="/usr/lib64/php/modules/soap.so"

我不確定還有哪些其他資訊有用,但任何幫助將不勝感激。

答案1

php-soap是在 EPEL 中,所以我不會費心去編譯它。

像這樣安裝:

yum install epel-release
yum makecache
yum install php-soap

答案2

從您的設定指令來看,您沒有使用 SOAP 設定進行編譯。請嘗試新增以下選項來編譯您的 PHP:

--enable-soap=shared

因此,編譯的完整命令應更改為:

'./configure' '--disable-fileinfo' '--enable-bcmath' '--enable-calendar' '--enable-ftp' '--enable-gd-native-ttf' '--enable-libxml' '--enable-pdo=shared' '--enable-sockets' '--prefix=/usr/local' '--with-apxs2=/usr/local/apache/bin/apxs' '--with-curl=/opt/curlssl/' '--with-freetype-dir=/usr' '--with-gd' '--with-imap=/opt/php_with_imap_client/' '--with-imap-ssl=/usr' '--with-jpeg-dir=/usr' '--with-kerberos' '--with-libdir=lib64' '--with-libxml-dir=/opt/xml2/' '--with-mcrypt=/opt/libmcrypt/' '--with-mysql=/usr' '--with-mysql-sock=/var/lib/mysql/mysql.sock' '--with-openssl=/usr' '--with-openssl-dir=/usr' '--with-pcre-regex=/opt/pcre' '--with-pdo-mysql=shared' '--with-pdo-sqlite=shared' '--with-pic' '--with-png-dir=/usr' '--with-xpm-dir=/usr' '--with-zlib' '--with-zlib-dir=/usr'--enable-soap=shared

然後,透過以下方式複製已編譯的 SOAP 模組:

cp modules/soap.so /usr/lib64/php/modules

使用以下命令重新啟動 Apache Web 伺服器:

/etc/init.d/httpd restart

然後檢查 phpinfo() 頁面是否啟用了 SOAP 擴充。

答案3

嘗試使用以下命令進行安裝。

yum install php54-php-soap

相關內容