解决cURL error 60: SSL certificate problem: unable to get local issuer certifica

今天在做本地环境开发阿里云短信验证时报错:cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html)

解决办法

进入:https://curl.se/docs/caextract.html

解决cURL error 60: SSL certificate problem: unable to get local issuer certifica_第1张图片

 

下载最新版Cacert.pem
复制这个文件到php的安装目录下,如下图所示

解决cURL error 60: SSL certificate problem: unable to get local issuer certifica_第2张图片

 

打开php.ini文件,搜索curl.cainfo 去掉前面的#注释 填上该文件的绝对路径,如下图所示: 

 解决cURL error 60: SSL certificate problem: unable to get local issuer certifica_第3张图片

*注意:如果按照上面这个方式还报错的可能就是openssl没有开启,php的openssl扩展需要开启 

解决cURL error 60: SSL certificate problem: unable to get local issuer certifica_第4张图片

 

你可能感兴趣的:(PHP,ssl,网络协议,网络,php)