您的位置:首页 > 产品设计 > UI/UE

SSL certificate problem: unable to get local issuer certificate 解决方法

2017-05-27 20:17 1006 查看
运行 php:
<?php
echo "hello ,this is a http request test!!! "."\n";

$get_user_info_url='https://www.baidu.com/';

$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$get_user_info_url);
curl_setopt($ch,CURLOPT_HEADER,0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
$res = curl_exec($ch);
print_r ($res);

if(curl_errno($ch)){
echo 'error:'.curl_error($ch);
}
curl_close($ch);

报错 SSL certificate problem: unable to get local issuer certificate解决方法:

在php.ini(也可能是php_production.ini 或者php_ development.ini,具体看自己用的事那个配置) 中 添加

curl.cainfo="C:/ca-bundle.crt"//自己的目录

openssl.cafile="C:/ca-bundle.crt"//自己的目录

ca-bundle.crt 下载地址 http://download.csdn.net/detail/qq_27317147/9854558
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  php ssl ca-bundle
相关文章推荐