cURL error 60 错误解决办法

  • Post author:
  • Post category:其他



php在curl的时候报此错误:

cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)


根据报错后面提示的地址查询60错误:

CURLE_SSL_CACERT (60)
Peer certificate cannot be authenticated with known CA certificates.


无法获取本地颁发者证书



关于“SSL证书问题:无法获取本地颁发者证书”错误。显然,这适用于发送CURL请求的系统(并且没有接收请求的服务器)

1)从

https://curl.haxx.se/ca/cacert.pem

下载最新的cacert.pem

2)将以下行添加到php.ini(如果这是共享托管和您没有访问php.ini然后你可以添加到.user.ini在public_html)

curl.cainfo=/path/to/downloaded/cacert.pem

3)默认情况下,FastCGI进程将每隔300秒解析新文件(如果需要,您可以通过添加几个文件来更改频率,如这里建议的

https://ss88.uk/blog/fast-cgi-and-user-ini

-files-the-new-htaccess /)



版权声明:本文为qq_35255775原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。