详情页

Z-blogPHP插件《Favicon.ico远程获取API》可能会出现的错误提示解决方案

时间:2023年05月24日

编辑:佚名

使用我们的插件《Favicon.ico远程获取API》时,可能会出现如下错误提示:
file_get_contents(/zb_users/plugin/faviconapi/img/get.php?url=https://******): Failed to open stream: HTTP request failed!
不要着急,这不是bug。
如果你百度一下,你会找到很多文章写着相同的解决方案,然而大致都比较啰嗦。
以下是我们总结的,更精炼的解决方案:
当使用php5自带的file_get_contents方法来获取远程文件的时候,有时候会出现file_get_contents(): : Failed to open stream: HTTP request failed!
修改php.ini,把allow_url_fopen给启用,改成 allow_url_fopen = On
不想改php.ini,你可以换成php7.0以上版本。
另外,我们也不建议你使用PHP8.0和8.0以上版本,可能也会报错。
相关文章
猜你需要