我試圖執行一個簡單的PHP調用加載網頁的內容: $result = file_get_contents("http://www.google.com");
的file_get_contents與HTTP:沒有這樣的文件或目錄
回來的結果是沒有發現一個奇怪的文件錯誤: Warning: file_get_contents(http://www.google.com): failed to open stream: No such file or directory in /var/www/html/test.php on line 5
我有「allow_url_fopen選項=在」我的php.ini並可能改變該目錄中的設置沒有.htaccess文件。有任何想法嗎?在不同的服務器上,我從來沒有遇到這個函數的麻煩。
你試過把'圍繞網址? – Zed 2009-08-17 16:34:02
file_get_contents行中有雙引號,錯誤只是不顯示它們。單引號具有相同的效果。 – timbonicus 2009-08-17 16:55:49