libcurl中不支持或禁用PHP 7.2.11协议“ https”

时间:2018-12-04 13:47:51

标签: curl centos7 php-7.2

我正在使用带有Laravel 5.7的Google reCaptcha V3进行编码

当我使用 curl 检查reCaptcha结果时

错误: libcurl中不支持或禁用协议“ https”

我的PHP代码:

$curl = curl_init('https://www.google.com/recaptcha/api/siteverify');

$post_parameters = [
    'secret'=>[googleSecretKey],
    'response'=>[googleRecaptcha],
    'remoteip'=>[remoteip],
];

curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");

curl_setopt($curl, CURLOPT_POST, 1);

curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($post_parameters));

curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded'));

//$result = curl_exec($curl);

if(!$result = curl_exec($curl)) {

    trigger_error(curl_error($curl));
}

curl_close($curl);

这是我的phpinfo

enter image description here

这是我的CentOS7中的卷曲信息

curl 7.29.0 (x86_64-redhat-linux-gnu) libcurl/7.29.0 NSS/3.34 zlib/1.2.7 libidn/1.28 libssh2/1.4.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp scp sftp smtp smtps telnet tftp 
Features: AsynchDNS GSS-Negotiate IDN IPv6 Largefile NTLM NTLM_WB SSL libz unix-sockets 

在我的CentOS7中,curl协议可用于https

我该如何解决??

对不起,我的英语不好

0 个答案:

没有答案