且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

cURL 错误 60:SSL 证书:无法获得本地颁发者证书

更新时间:2022-06-10 05:15:09

如何解决这个问题:

  • 按照 cacert.pem"https://curl.se/docs/caextract.html" rel="nofollow noreferrer">https://curl.se/docs/caextract.html

  • download and extract cacert.pem following the instructions at https://curl.se/docs/caextract.html

将其保存在您的文件系统中的某个位置(例如,XAMPP 用户可能使用 C:xamppphpextrassslcacert.pem)

save it on your filesystem somewhere (for example, XAMPP users might use C:xamppphpextrassslcacert.pem)

在你的 php.ini 中,把这个文件位置放在 [curl] 部分(把它放在 [openss] 部分也是一个好主意):

in your php.ini, put this file location in the [curl] section (putting it in the [openss] section is also a good idea):

[curl]
curl.cainfo = "C:xamppphpextrassslcacert.pem"

[openssl]
openssl.cafile = "C:xamppphpextrassslcacert.pem"