Home  >  Article  >  Backend Development  >  curl post报错问题

curl post报错问题

WBOY
WBOYOriginal
2016-06-23 13:44:351593browse

 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);

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn