File_get_contents函数不适用于Windows?
问题描述:
file_get_contents("https://api.groupon.com/v2/deals.xml?division_id=cleveland&client_id=39ddf70c45844d5a9d5a92e5106f1b229b2e1df8");
此代码不适用于Windows,但适用于Linux。由于https。有没有解决办法。File_get_contents函数不适用于Windows?
答
有可能您没有在您的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
“它不工作”,是不是错误。相反,告诉我们你正在得到什么?错误?白页... – samayo
显示白页。 – Vivek
另一个链接怎么样?像[StackOverflow](http://stackoverflow.com)? – samayo