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 坐等高手