简体   繁体   English

用PHP解析WSDL问题

[英]Parsing WSDL Issue in PHP

I have a WSDL for a service provider that sits locally on my Apache instance and is referenced by my PHP application. 我有一个服务提供者的WSDL,它位于我的Apache实例本地,并由我的PHP应用程序引用。 However, when my scripts call the WSDL, I'm seeing the error below in the Apache logs and the script fails: 但是,当我的脚本调用WSDL时,我在Apache日志中看到以下错误,并且脚本失败:

PHP Fatal error:  SOAP-ERROR: Parsing WSDL: Couldn't load from  
'https://x.x.com/MyWSDL.wsdl' : failed to load external entity
"https://x.x.com/MyWSDL.wsdl"\n in /SCRIPTS/SCRIPTS_myscripts.php
on line 112

I can access the WSDL externally using a browser with no issue. 我可以使用浏览器从外部访问WSDL,没有问题。 I can also access it locally from the linux server (using lynx) with no issue. 我也可以从linux服务器(使用lynx)在本地访问它,没有问题。 What is odd is I have this exact same setup working on another box (just older versions of PHP and Apache). 奇怪的是,我在另一个机器上使用了完全相同的设置(只是旧版本的PHP和Apache)。 Wondering if there's something new in the PHP config I'm overlooking? 想知道我忽略的PHP配置中是否有新内容? Not even sure how to continue troubleshooting this since I can download the WSDL externally and internally using that URL. 甚至不知道如何继续对此进行故障排除,因为我可以使用该URL在内部和外部下载WSDL。

Thanks in advance for any advice! 在此先感谢您的任何建议!

UPDATE: After doing a little more digging, I've discovered this is somehow related to mod_security. 更新:经过更多的挖掘之后,我发现这与mod_security有关。 If I disable mod_security, the soap call works without issue. 如果我禁用mod_security,则soap调用将正常工作。 I've tried to determine how to create a mod_security exception for this but I'm not coming up with much. 我试图确定如何为此创建一个mod_security异常,但是我没有提出太多建议。 Really don't want to turn the entire module off. 真的不想关闭整个模块。

Try uncommenting this line in your php.ini: extension=php_openssl.dll 尝试在php.ini中取消注释此行:extension = php_openssl.dll

Hope that helps! 希望有帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM