$curl = curl_init();
/*
curl_setopt_array($curl,
array(
CURLOPT_URL => $url,
CURLOPT_REFERER => $url,
CURLOPT_AUTOREFERER => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_CONNECTTIMEOUT => 1,
CURLOPT_TIMEOUT => 30,
CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.116 Safari/537.36'
)
);
*/
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl,CURLOPT_URL,$url);
curl_setopt($curl,CURLOPT_RETURNTRANSFER,1);
//curl_setopt($curl, CURLOPT_HTTPHEADER, array('Expect:'));
//curl_setopt($curl, CURLOPT_HEADER, true);
$res = curl_exec($curl);没有办法获取accessToken真无奈,难道每次都要通过接口调试工具吗?请问老师正确的打开办法?返回结果:200 OKConnection: closeDate: Mon, 13 Jun 2016 03:25:04 GMTContent-Type: application/json; encoding=utf-8Content-Length: 175{ "access_token": "####", "expires_in": 7198}提示:Request successful
2 回答
微笑de迪妮莎
TA贡献1条经验 获得超3个赞
找到问题了,返回int(77) Problem with the SSL CA cert (path? access rights?)
linix里面运行了下No package ca-certificate 好吧。curl函数使用环境有问题
- 2 回答
- 1 关注
- 3342 浏览
添加回答
举报
0/150
提交
取消