php error:0A000126:SSL routines::unexpected eof while reading

2023-11-15

文章目录

问题

...
file_get_contents("https://api.weixin.qq.com/sns/jscode2session?appid={$this->appid}&secret={$this->secret}&js_code={$wx_code}&grant_type=authorization_code");
        $wx_resp = json_decode($bac);
...

在这里插入图片描述

解决

1.确认 php.ini 中, ca 证书的路径正确配置。

在这里插入图片描述
php 中 ca 证书配置

2.参考 php 官方文档说明

file_get_contents

在这里插入图片描述
将问题代码改成:

@file_get_contents("https://api.weixin.qq.com/sns/jscode2session?appid={$this->appid}&secret={$this->secret}&js_code={$wx_code}&grant_type=authorization_code");
        $wx_resp = json_decode($bac);

前面加一个 @

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

php error:0A000126:SSL routines::unexpected eof while reading 的相关文章

随机推荐