在windows下的php.ini文件里
找到这一行代码(如没有则自行添加)
extension=php_soap.dll
SOAP在php.ini中还有自己的配置部分,如下所示
[soap]
; Enables or disables WSDL caching feature.
soap.wsdl_cache_enabled=1
; Sets the directory name where SOAP extension will put cache files.
soap.wsdl_cache_dir="/tmp"
; (time to live) Sets the number of second while cached file will be used
; instead of original on
soap.wsdl_cache_ttl=86400
这段配置控制了SOAP扩展的WSDL缓存特性。默认情况下,WSDL描述文件在24小时(86400sec)内都在缓存设置的目录下。
另外还需要修改一下代码段,将always_populate_raw_post_da
; Always populate the $HTTP_RAW_POST_DA
always_populate_raw_post_da
然后找到如下代码,设置为0
soap.wsdl_cache_enabled=0
这样,在代码调试时,避免遇到一些莫名其妙的错误,完成web服务开发之后,要记得改为1,即打开WSDL缓存,使代码运行得更快。
为了证明你成功配置好SOAP,请使用phpinfo()函数确认下:站长教学网 eduyo.com