PHP配置環境中支持file_get_contents、file、fopen打開遠程url時總是報錯,錯誤信息如下:
Warning: file_get_contents() [function.file-get-contents]: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in /usr/vogue/upload/1.php on line 4
Warning: file_get_contents(http://blog.sina.com.cn/myblog/index_rss.php?uid=1190363061)
[function.file-get-contents]: failed to open stream: Connection refused in /usr/vogue/upload/1.php on line 4
這可能是服務器DNS出問題,造成了路由結果中有部分路由執行超時,最終PHP執行時間超時,導致采集與RSS導
用到這類型的函數娶不到內容而無法使用此項功能。
解決辦法:
檢查一下環境是否開始了allow_url_fopen,在服務器上跟蹤一下路由是否有斷網的節點存在,如存在更換DNS。
新聞熱點
疑難解答
圖片精選