Php 窗口WAMP报告';SSL证书问题:无法获取本地颁发者证书';使用带有curl扩展名的https请求时
它在我的centos7 linux环境中工作。 但它在我的windowwamp(PHP7.0)环境中报告了“SSL证书问题:无法获取本地颁发者证书” 这是我的php curl版本 这是我的密码Php 窗口WAMP报告';SSL证书问题:无法获取本地颁发者证书';使用带有curl扩展名的https请求时,php,curl,https,window,certificate,Php,Curl,Https,Window,Certificate,它在我的centos7 linux环境中工作。 但它在我的windowwamp(PHP7.0)环境中报告了“SSL证书问题:无法获取本地颁发者证书” 这是我的php curl版本 这是我的密码 $func = function ($url, $post) { $header[] = "Content-type: text/xml"; $curl = curl_init(); curl_setopt($cu
$func = function ($url, $post)
{
$header[] = "Content-type: text/xml";
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HEADER, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_SSLCERTTYPE,'PEM');
curl_setopt($curl, CURLOPT_SSLCERT, './cert.pem');
curl_setopt($curl, CURLOPT_SSLKEYTYPE,'PEM');
curl_setopt($curl, CURLOPT_SSLKEY,'./key.pem');
curl_setopt($curl, CURLOPT_POSTFIELDS, $post);
$data = curl_exec($curl);
if ($data) {
curl_close($curl);
} else {
$data = curl_error($curl);
curl_close($curl);
}
return $data;
};
var_dump($func($url, $post));
嗯。我解决了。
只需在php.ini中使用'curl.cainfo'参数配置CA路径。
以下是链接:
好的。我解决了。
只需在php.ini中使用'curl.cainfo'参数配置CA路径。
以下是链接: