13

Zblog报错“PHP file_get_contents函数获取https内容”解决方法

 3 years ago
source link: https://www.huhexian.com/19654.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Zblog报错“PHP file_get_contents函数获取https内容”解决方法

青山 2021-12-2716:50:52评论466字

今天在排查另外一个网站的时候,发现导航主题在部分情况下会出现错误,报错代码如下:“PHP file_get_contents函数获取https内容”,通过度娘,查询到了是file_get_contents函数的问题,下面就来给大家讲解一下解决方法:

Zblog报错“PHP file_get_contents函数获取https内容”解决方法

在网上找了两种做多的方法,一个是修改php.ini配置文件,找到“extension=php_openssl.dll”这一行,去掉前面的“;”另外一个是找到“allow_url_include = Off ”这一行,将Off改为On,然后重启服务器。两种方法尝试后完全不管用,尤其是修改了“extension=php_openssl.dll”文件之后无法重启php。

解决方法:

找到include.php文件,将“//top.baidu.com/buzz?b=1&fr=topcategory_c513”修改成“http://top.baidu.com/buzz?b=1&fr=topcategory_c513”,如图:

Zblog报错“PHP file_get_contents函数获取https内容”解决方法

修改完成后,后台修改完成后,后台首页“清空缓存并编译模板”,这样就解决了。


Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK