<?php
public function getQrCode(){
//全局票据access_token 网页授权access_token 二维码jsapi_ticket js_sdk
$wxObj = new \WX($this->appid,$this->appsecret);
$access_token = $wxObj->getWxAccesstoken();
$url = "https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=".$access_token;
//{"expire_seconds": 604800, "action_name": "QR_SCENE", "action_info": {"scene": {"scene_id": 123}}}
$postArr = array(
'expire_seconds'=>604800,
'action_name'=>"QR_SCENE",
'action_info'=>array(
'scene'=>array('scene_id'=>2000)
)
);
$postJson = json_encode($postArr);
// echo $url;die;
$res = $this->httpCurl($url,$postJson);
var_dump($res);
}
public function httpCurl($url,$data){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json; charset=utf-8',
"Content-length: ".strlen($data)
));
$rtn = curl_exec($ch);
if(curl_errno($ch)){
echo 'curl error: '.curl_error($ch);die;
}
curl_close($ch);
return $rtn;
}
浏览器输出报错:
curl error: SSL certificate problem: unable to get local issuer certificate
这是什么问题呢