错误信息表示 php.ini中配置的CA证书不到
第一步:下载最新证书
第二步:将下载的cacert.pem重命名为:curl-ca-bundle.crt
如果是windows开发环境,必须将名称重命名为:curl-ca-bundle.crt
第三步:修改php.ini文件 配置 curl.cainfo、openssl.cafile、openssl.capath 如下:
# php.ini文件
......
[curl]
; A default value for the CURLOPT_CAINFO option. This is required to be an
; absolute path.
curl.cainfo ="G:\phpstudy_pro\Extensions\php\php7.1.9nts\extras\ssl\curl-ca-bundle.crt" # 替换为你的ca证书路径
[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="G:\phpstudy_pro\Extensions\php\php7.1.9nts\extras\ssl\curl-ca-bundle.crt" # 替换为你的ca证书路径
; 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="G:\phpstudy_pro\Extensions\php\php7.1.9nts\extras\ssl" # 替换为你的ca证书所在目录路径