【问题标题】:SOAP-ERROR: Parsing WSDL: Couldn't load from urlSOAP-ERROR:解析 WSDL:无法从 url 加载
【发布时间】:2012-03-02 11:49:02
【问题描述】:

执行以下行时出现此错误:

$client = new soapclient('https://example.com/xxx/pgw?wsdl=xyz.wsdl');

错误:

SoapFault: SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://localhost:8080/xxx/pgw?wsdl=xyz.wsdl' : failed to load external entity "http://localhost:8080/xxx/pgw?wsdl=xyz.wsdl" in SoapClient->SoapClient() (line 39 of /var/www/.../myscript.php).

我已经在浏览器中检查了 URL,没关系。 什么可能导致错误?

【问题讨论】:

标签: php soap ssl


【解决方案1】:

我今天遇到了同样的问题,几个小时后,在我的 WSDL URL 上尝试了file_get_contents 之后,我注意到我的 apache 错误日志中出现了权限被拒绝错误。我发现 SELinux 是罪魁祸首。我相信默认情况下,SELinux 会阻止 httpd 发出自己的网络请求(至少在 Fedora 上)。

修复是:setsebool -P httpd_can_network_connect 1,然后允许 Apache 连接到远程服务(它适用于 SSL 和非 SSL 请求)。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-02-27
    • 2012-06-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多