获取手机验证码出现,请在php.ini内配置curl.cainfo怎么解决

获取手机验证码出现,请在php.ini内配置curl.cainfo怎么解决

1个回答默认排序 投票数排序
PHP_Daemon
PHP_Daemon
这家伙很懒,什么也没写~
8月前

到 https://curl.haxx.se/ca/cacert.pem 下载证书文件 cacert.pem,将其保存到合适的路径下。
编辑 php.ini 文件,删除 curl.cainfo 配置项前的分号注释符(;),值设置为保存的证书文件 cacert.pem 的绝对路径。
重启依赖 PHP 的服务。
linux示例:

[curl]
; A default value for the CURLOPT_CAINFO option. This is required to be an
; absolute path.
curl.cainfo = /etc/pki/tls/certs/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.

windows示例:

[curl]
; A default value for the CURLOPT_CAINFO option. This is required to be an
; absolute path.
curl.cainfo = "E:\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=
请先登录
0
1
0
1