PHP:file_get_contents无法打开流:连接被拒绝 [英] PHP: file_get_contents failed to open stream: Connection refused

查看:219
本文介绍了PHP:file_get_contents无法打开流:连接被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 file_get_contents 和simple_load_xml,我得到 无法打开流:连接被拒绝"
结果如何?

I am trying to access a second server with file_get_contents and simple_load_xml and I get "failed to open stream: Connection refused"
What can be the result?

allow_url_fopen=Yes
allow_url_include=Off

是我的php.ini值

is my php.ini values

推荐答案

听起来像第二台服务器正在拒绝文件,请尝试使用

Sounds like the 2nd server is rejecting the file, try using curl to obtain the file instead; the benefit of using curl is that it'll give you helpful debugging information in the event of a failure like this. get_file_content() masks a lot of this helpful information.

这篇关于PHP:file_get_contents无法打开流:连接被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆