[英]PHP Curl error 60 querying reCAPTCHA API
我有一个PHP站点,可通过HTTPS查询多个API。 所有工作,除了reCAPTCHA。 这将产生以下错误:
cURL error 60: SSL certificate problem: unable to get local issuer certificate (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)
解决此问题的常见方法是从curl网站下载.pem文件并将其添加到PHP.ini文件中,我这样做是:
[curl]
; A default value for the CURLOPT_CAINFO option. This is required to be an
; absolute path.
curl.cainfo="/var/www/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="/var/www/cacert.pem"
该错误仍然会发生。 如果我检查phpinfo()
,则没有设置curl属性,但是openssl属性是:
我已经重新启动了php-fpm并重新启动了服务器,但无济于事。 启动日志中没有相关的错误。
我正在使用PHP版本7.2.4-1+ubuntu14.04.1+deb.sury.org+1
通过将OpenSSL升级到最新版本OpenSSL 1.1.0h 27 Mar 2018
解决了此问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.