WAMP&Laravel:cURL error 60: SSL certificate problem: unable to get local issuer certificate
"message": "cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://api.weixin.qq.com/sns/jscode2session?appid=wxf8b9dbefc889bcaf&secret=3ed00514cbe0a52c6d708a76ba318acd&js_code=0e3zkmFa1Xrd2I0e6lIa1PWwcv1zkmFO&grant_type=authorization_code",
CURLE_PEER_FAILED_VERIFICATION (60)
The remote server's SSL certificate or SSH fingerprint was deemed not OK. This error code has been unified with CURLE_SSL_CACERT since 7.62.0. Its previous value was 51.
1、进入以下链接下载pem
证书
https://curl.se/docs/caextract.html
2、执行下述命令,找到文件目录
php -i | findstr php.ini
3、将下载的文件放到php.ini
同级目录的./extras/ssl
下
4、编辑php.ini
,搜索curl.cainfo
,以下形式,将文件路径添加,并把注释符号;
去掉
5、查看openssl
扩展打开了吗?
php.ini
搜索openssl
,前边有;
注释的话去掉
6、清除缓存
php artisan cache:clear
7、测试还不行的话,那就直接从wamp
里直接找到php.ini
,如果你用wamp
的话大概率和我是一样的问题,见下图
因为我刚开始按照上边的步骤改完保存后,发现从wamp
里打开的php.ini
根本就没动,才发现改错文件了,在使用Apache
的情况下,应该改phpForApache.ini
文件。
还不快抢沙发