PHP:file_get_content无法打开流:连接被拒绝 [英] PHP: file_get_content failed to open stream: Connection refused
本文介绍了PHP:file_get_content无法打开流:连接被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用file_get_content和simple_load_xml访问第二台服务器而我得到
无法打开流:拒绝连接
结果会是什么?
I am trying to access a second server with file_get_content 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
推荐答案
听起来像第二台服务器是拒绝该文件,请尝试使用 curl 来获取该文件;使用curl的好处是,它会在发生此类故障时为您提供有用的调试信息。 get_file_content()掩盖了很多有用的信息。
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_content无法打开流:连接被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文