curl_setopt() expects parameter 2 to be long 是什么错误??
//初始化curl $ch = curl_init(); //设置超时 curl_setopt($ch, curlop_timeout, $this->curl_timeout); curl_setopt($ch, curlopt_url, $url); curl_setopt($ch,curlopt_ssl_verifypeer,false); curl_setopt($ch,curlopt_ssl_verifyhost,false); curl_setopt($ch, curlopt_header, false); curl_setopt($ch, curlopt_returntransfer, true); //运行curl,结果以jason形式返回 $res = curl_exec($ch); curl_close($ch);
回复讨论(解决方案) 哪行报错??
curl_setopt($ch, curlop_timeout, $this->curl_timeout);
改成
curl_setopt($ch, curlo p_timeout, $this->curl_timeout);
看错了,改成这样
curl_setopt($ch, curlop t_timeout, $this->curl_timeout);