gpt4 book ai didi

php - File_get_contents 函数不适用于 Windows?

转载 作者:太空宇宙 更新时间:2023-11-04 05:05:08 25 4
gpt4 key购买 nike

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

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

最佳答案

您可能没有在 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');

关于php - File_get_contents 函数不适用于 Windows?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17632484/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com