PHP8.1.21版本已发布
vue8.1.21版本已发布
jquery8.1.21版本已发布

nginx+php5.3.20上,file_get_contents无法使用

原创
2016-06-13 11:16:19 687浏览

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 坐等高手
声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。