• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

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

php 搞代码 3年前 (2022-01-24) 15次浏览 已收录 0个评论

nginx+php5.3.20下,file_get_contents无法使用,求助
file_get_contents外网的url完全没问题,但是如果要获取本机的url(比如6来源gaodaimacom搞#^代%!码网搞gaodaima代码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: http://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 坐等高手


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:nginx+php5.3.20上,file_get_contents无法使用
喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址