Php HTTPS站点上出现cURL错误60的可能原因是什么?

Php HTTPS站点上出现cURL错误60的可能原因是什么?,php,curl,https,Php,Curl,Https,浏览完网页后,我真是束手无策。我知道这个问题已经被问过好几次了,但没有一个解决方案能解决我的问题。我想知道curl错误60:SSL证书问题是否还有其他已知原因,请验证CA证书是否正常 我已经将CURLOPT_CAINFO设置为pem文件,也尝试了crt,并且在尝试访问pem文件时检查了权限是否不足 顺便说一下,下面是代码: $url = 'https://example.com/'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url)

浏览完网页后,我真是束手无策。我知道这个问题已经被问过好几次了,但没有一个解决方案能解决我的问题。我想知道curl错误60:SSL证书问题是否还有其他已知原因,请验证CA证书是否正常

我已经将CURLOPT_CAINFO设置为pem文件,也尝试了crt,并且在尝试访问pem文件时检查了权限是否不足

顺便说一下,下面是代码:

$url = 'https://example.com/';

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); 
curl_setopt($ch, CURLOPT_CAINFO, "/usr/local/apache2/htdocs/server/html/cacert.pem");

$response = curl_exec($ch);

...do something

curl_close($ch);
你可以试试这个:-

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, **'https://example.com/'**);
// Set so curl_exec returns the result instead of outputting it.
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
// Get the response and close the channel.
$response = curl_exec($ch);