接口请求报错:PHP:cURL error 60: SSL certificate unable to get local issuer certificate 是由于没有在php.ini配置curl.cainfo

解决方法如下:

  1. 下载cacert.pem

cacert.pem下载链接

将文件放置对应PHP版本目录中

  1. 配置php.ini

打开对应PHP版本的php.ini,搜索curl.cainfo,将前面的 ; 删掉,在后面加上cacert.pem所在的绝对路径

例子:

1
2
3
4
[curl]
; A default value for the CURLOPT_CAINFO option. This is required to be an
; absolute path.
curl.cainfo = D:\phpstudy_pro\Extensions\php\php7.2.9nts\cacert.pem