gpt4 book ai didi

php - SoapClient 无法加载 WSDL,需要重新启动 apache 才能再次工作

转载 作者:太空宇宙 更新时间:2023-11-03 17:17:27 25 4
gpt4 key购买 nike

服务器是带有 PHP 5.4 和 Apache 2.2 的 CENTOS。

我有一个像这样的 SoapClient 对象:

$client = new \SoapClient(__DIR__ . "/wsdlfilehere.wsdl", array("soap_version"=>SOAP_1_2, "trace"=>true));

一段时间后(24 小时内),这段代码会抛出一个错误:

SOAP-ERROR: Parsing WSDL: Couldn't load from '/wsdlfilehere.wsdl' : failed to load external entity "/wsdlfilehere.wsdl".

然后之后我重新启动apache,它再次工作。

编辑:即使将 cache_wsdl 设置为 WSDL_CACHE_NONE 也不能解决问题。

最佳答案

在四处挖掘之后,我终于找到了解决方法/解决方案。

关注此link on Ubuntu's launchpad似乎其他人也遇到了这个问题。我关注了zabuch's instruction at comment #6现在似乎可以工作了。我同意他的看法,问题可能出在 mod_php/php 本身,而不仅仅是 Ubuntu,因为我在 CentOS 上并且遇到过这个问题。

来自zabuch的评论:

The workaround for the issue is to add this:

libxml_disable_entity_loader(false);

before creating new SoapClient.

关于php - SoapClient 无法加载 WSDL,需要重新启动 apache 才能再次工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30994025/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com