nginx+php5.3.20下,file_get_contents无法使用,求助
file_get_contents外网的url完全没问题,但是如果要获取本机的url(比如http://localhost/index.php)就会报下面的错:
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while reading response header from upstream, client: 124.2xx.xxx.xxx, server: www.xxx.com, request: "GET /index.php HTTP/1.0", upstream: "fastcgi://127.0.0.1:9000", host: "www.xxx.com"
在网上找了这么一篇文章,http://www.codesky.net/article/201106/174247.html 但不知在Windows下面如何操作,或者有其他办法么,求助了
------解决方案--------------------修改hosts 弄个域名解析到本地
使用域名方式访问就可以解决了吧
或者直接ip地址试看看
------解决方案--------------------检查一下php.ini里,是不是 allow_url_fopen = 1?
另外尝试用include替换file_get_contents,获取localhost的页面。
------解决方案--------------------也遇到同样问题
和其他人对比 感觉 是
这个的问题,
mark 坐等高手