2013-07-13 43 views
-1
file_get_contents("https://api.groupon.com/v2/deals.xml?division_id=cleveland&client_id=39ddf70c45844d5a9d5a92e5106f1b229b2e1df8"); 

此代碼不適用於Windows,但適用於Linux。由於https。有沒有解決辦法。File_get_contents函數不適用於Windows?

+0

「它不工作」,是不是錯誤。相反,告訴我們你正在得到什麼?錯誤?白頁... – samayo

+0

顯示白頁。 – Vivek

+0

另一個鏈接怎麼樣?像[StackOverflow](http://stackoverflow.com)? – samayo

回答

1

有可能您沒有在您的PHP配置中打開您的url文件。

有關此配置值的詳細信息,請參閱http://www.php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen

如果這不是原因,那麼你應該指定確切的錯誤是什麼,通過添加以下到您的代碼做到這一點,的file_get_contents函數之前:

error_reporting(E_ALL); 
ini_set('display_errors', 'On'); 
+0

這些都是顯示,在解析錯誤「的file_get_contents()[function.file-GET-內容]:無法找到包裝‘HTTPS’ - 你忘記啓用它,當你配置PHP ? 消息: 的file_get_contents(https://api.groupon.com/v2/deals.xml?division_id=houston&client_id=39ddf70c45844d5a9d5a92e5106f1b229b2e1df8) [function.file-GET-內容]:未能打開流:沒有這樣的文件或目錄 「 – Vivek

相關問題