解决PHP SOAP client giving “Error Fetching http headers”

php
赞赏 2015-12-30

今天用SOAP时遇到了 PHP SOAP client giving “Error Fetching http headers”解决方法有2种


方法


1) 修改php.ini中的 default_socket_timeout

将default_socket_timeout改为更大值


2) 修改connection_timeout

$client = new SoapClient("http://****************?wsdl",array("trace"=>true,"connection_timeout"=>200)); 


但PHP 手册中是这么说的: 

Theconnection_timeoutoption defines a timeout in seconds for the connection to the SOAP service. This option does not define a timeout for services with slow responses. To limit the time to wait for calls to finish thedefault_socket_timeoutsetting is available.

翻译:

connection_timeout 只能定义连接SOAP service的超时时间,限制不了那种慢响应的超时,要定义从请求到响应的超时时间只能用default_socket_timeout。


登陆后阅读全文
阅读 4024 赞赏 2 有用 42 没用 0 收藏 17 分享

   


作者声明:本篇文章系本人原创,欢迎分享,但未经许可,谢绝转载。

0 条留言

赛蓝翔的头像

赛蓝翔

PHP开发一枚

相关文章

Linux php-fpm报错:allow_call_time_pass_reference

如何配置php显示错误信息?

6款程序员必备的开源中文汉字拼音转换及处理工具 (PHP Java .net)

PHP Fatal error: Allowed memory size of bytes exhausted

Linux 服务器如何隐藏 PHP 版本号?

PHP 程序无法识别短标签

改了php.ini中的open_basedir仍报错open_basedir restriction in effect

原来这条命令可以让我们快速找到php.ini的位置

php call_user_fun Call-time pass-by-reference has been remov

php.ini 设置了 error_log 为什么不生效?

有料推荐

这世界欠我一个这样的老公!

高校学生模仿“世界名画”摆拍,可以说是戏精本精了

iPhone X 跌破发行价,苏宁200亿入股恒大 | 财经日日评

果然是高手!这次在日本,特朗普竹杠敲得不是一般狠

资深黄牛现身说法:iPhone X价格秒变不停,就像炒股一样

长一样的双胞胎也能识别?蚂蚁金服发布「眼纹识别」技术

苏联是怎么被阿富汗拖垮的?

美团或入局「分时租赁」共享汽车,王兴要大笔投入「泛出行」领域了? | 36氪独家

你或许被“一盘番茄炒蛋”刷屏了,但有人辛酸,有人质疑

iPhone X发售前夜,黄牛与苹果公司的不安

他的文章

微信跳一跳刷分攻略

改了php.ini中的open_basedir仍报错open_basedir restriction in effect

推荐 | PHP WEB消息推送框架 web-msg-sender (PHPSocket.IO)

如何准确判断请求是不是搜索引擎爬虫(蜘蛛)发出的请求?(php window linux)

PHP Warning: feof() expects parameter 1 to be resource, null

php Warning: A non-numeric value encountered in

原来这条命令可以让我们快速找到php.ini的位置

换成https后,网站还是没有安全标志或安全小锁?

在百度站长平台如何将http换成https

php file_get_contents() 如何伪造发送 referer?

手机扫一扫
分享文章