CURL出现code ERROR 60错误

$ch = curl_init();//初始化curl
 curl_setopt($ch, CURLOPT_URL,$this->get_token_url);//抓取指定网页
 curl_setopt($ch, CURLOPT_POST, 1);//post提交方式
 curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
 $re_data = curl_exec($ch);//运行curl
 if($re_data === false){
      echo curl_errno($ch);
      exit();
  }

 curl_close($ch);

输出60错误,

无法使用已知的 CA 证书验证对等证书


https://curl.haxx.se/ca/cacert.pem 下载cacert.pem文件

放到php路径下的【extras\ssl\】文件夹里面。

然后打开【php.ini】文件,找到最后面的【curl.cainfo = 】修改为【curl.cainfo = cacert.pem文件路径】,保存即可

重启phpstudy

猜你喜欢

转载自blog.csdn.net/qq_34092577/article/details/80777559
今日推荐