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

臭大佬 2019-11-05 10:16:03 2908
php  laravel 
简介 cURL error 60: SSL certificate problem: unable to get local issuer certifica 解决

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

从 https://curl.haxx.se/docs/caextract.html 上下载cacert.pem

打开php.ini  搜索curl.cainfo 与 openssl.cafile,将其配置成你自己cacert.pem文件的路径

curl.cainfo=" 路径 "

openssl.cafile="路径"

例如:

[curl]
; A default value for the CURLOPT_CAINFO option. This is required to be an
; absolute path.
curl.cainfo = "E:\phpstudy_pro\Extensions\php\cacert.pem"

[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="E:\phpstudy_pro\Extensions\php\cacert.pem"

; 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=