1.下载证书
https://curl.se/docs/caextract.html
2.重命名
将 cacert.pem 重命名为 curl-ca-bundle.crt
3.修改php.ini
curl.cainfo openssl.cafile openssl.capath
[curl] ; A default value for the CURLOPT_CAINFO option. This is required to be an ; absolute path. curl.cainfo = "D:\curl-ca-bundle.crt" [openssl] ; The location of a Certificate Authority (CA) file on the local filesystem ; to use when verifying the identity of SSL/TLS peers. Most users should ; not specify a value for this directive as PHP will attempt to use the ; OS-managed cert stores in its absence. If specified, this value may still ; be overridden on a per-stream basis via the "cafile" SSL stream context ; option. openssl.cafile="D:\curl-ca-bundle.crt" ; If openssl.cafile is not specified or if the CA file is not found, the ; directory pointed to by openssl.capath is searched for a suitable ; certificate. This value must be a correctly hashed certificate directory. ; Most users should not specify a value for this directive as PHP will ; attempt to use the OS-managed cert stores in its absence. If specified, ; this value may still be overridden on a per-stream basis via the "capath" ; SSL stream context option. openssl.capath="D:\"
本文为看恩吧原创文章,转载无需和我联系,但请注明来自knsay.com