微信自定义菜单
php吧
全部回复
仅看楼主
level 7
public function curl($appid,$secret)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=".$appid."&secret=".$secret);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
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_RETURNTRANSFER, true);
$tmpInfo = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Errno'.curl_error($ch);
}
curl_close($ch);
$arr= json_decode($tmpInfo,true);
return $arr;
}
不知道为什么,每次执行到curl_exec那里就变成服务器转置了[不高兴]
2014年06月11日 07点06分 1
level 7
没人回,自己顶个,还是那个curl_exec()问题,现在变成了nginx 502 bad gateway了[狂汗]
2014年06月25日 06点06分 2
还是靠自己解决了[冷]搞了这么多天,原来是php版本问题,出现错误的php版本是 5.2.17,升级一下就好了
2014年06月25日 11点06分
level 7
补充下,那个不是curl的问题,是php那个版本不支持https,所以才出现的链接错误[笑眼]
2014年07月05日 07点07分 3
level 10
你怎么获取的appid的?花300了?求告知,我也在业务时间做,可是被300块搁浅了
2014年07月05日 09点07分 4
level 7
之前我们经理申请好了的[笑眼]
2014年07月07日 00点07分 5
1