0
file_get_contents("https://api.groupon.com/v2/deals.xml?division_id=cleveland&client_id=39ddf70c45844d5a9d5a92e5106f1b229b2e1df8");

此代码不适用于 Windows,但适用于 Linux。因为https。有什么解决办法。

4

1 回答 1

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');
于 2013-07-13T17:32:38.400 回答