php linux curl_exec() 微信
function api_notice_increment($url, $data){
$ch = curl_init();
$header = accept-charset: utf-8;
curl_setopt($ch, curlopt_url, $url);
curl_setopt($ch, curlopt_customrequest, post);
curl_setopt($ch, curlopt_ssl_verifypeer, false);
curl_setopt($ch, curlopt_ssl_verifyhost, false);
curl_setopt($ch, curlopt_sslversion, curl_sslversion_tlsv1);
curl_setopt($curl, curlopt_httpheader, $header);
curl_setopt($ch, curlopt_useragent, 'mozilla/5.0 (compatible; msie 5.01; windows nt 5.0)');
curl_setopt($ch, curlopt_followlocation, 1);
curl_setopt($ch, curlopt_autoreferer, 1);
curl_setopt($ch, curlopt_postfields, $data);
curl_setopt($ch, curlopt_returntransfer, true);
echo start;
$tmpinfo = curl_exec($ch);
echo $tmpinfo;
echo end;
$errorno=curl_errno($ch);
if ($errorno) {
return array('rt'=>false,'errorno'=>$errorno);
}else{
$js=json_decode($tmpinfo,1);
if ($js['errcode']=='0'){
return array('rt'=>true,'errorno'=>0);
}else {
$errmsg=geterrormsg::wx_error_msg($js['errcode']);
$this->error($js['errcode'].':'.$errmsg.'!!');
}
}
}
在window上没有任何问题,但是在linux系统上$tmpinfo返回为空,curl的版本之前是4.4 现在换成了7.44 还是不行,请教一下,这个是什么问题,困扰很久了
------解决思路----------------------
你php的 openssl开了吗