奇了怪了。CURL同样代码,GET百度或者其他网站都没有问题,GET本地HTML也没有问题。只要是GET本地PHP文件就卡住。
本地环境WIN7 nginx php7,不涉及数据库。有哪位大神知道帮我一下。
这是代码,但我感觉不是代码问题啊。$s = curl_init();
curl_setopt($s, CURLOPT_URL, $this->url);
curl_setopt($s, CURLOPT_TIMEOUT, $this->timeout);
curl_setopt($s, CURLOPT_MAXREDIRS, $this->maxRedirects);
curl_setopt($s, CURLOPT_RETURNTRANSFER, $this->returnTransfer);
curl_setopt($s, CURLOPT_FOLLOWLOCATION, $this->followlocation);
curl_setopt($s, CURLOPT_HEADER, $this->includeHeader);
curl_setopt($s, CURLOPT_NOBODY, $this->noBody);
curl_setopt($s, CURLOPT_BINARYTRANSFER, $this->binaryTransfer);
curl_setopt($s, CURLOPT_REFERER, $this->referer);
if($this->authentication){
curl_setopt($s, CURLOPT_USERPWD, $this->auth_name.':'.$this->auth_pass);
}
if($this->post){
curl_setopt($s, CURLOPT_POST, true);
curl_setopt($s, CURLOPT_POSTFIELDS, $this->postFields);
}
$this->result = curl_exec($s);
$this->status = curl_getinfo($s, CURLINFO_HTTP_CODE);
curl_close($s);
还有个问题,用curl POST为什么是空白?
本地环境WIN7 nginx php7,不涉及数据库。有哪位大神知道帮我一下。
这是代码,但我感觉不是代码问题啊。$s = curl_init();
curl_setopt($s, CURLOPT_URL, $this->url);
curl_setopt($s, CURLOPT_TIMEOUT, $this->timeout);
curl_setopt($s, CURLOPT_MAXREDIRS, $this->maxRedirects);
curl_setopt($s, CURLOPT_RETURNTRANSFER, $this->returnTransfer);
curl_setopt($s, CURLOPT_FOLLOWLOCATION, $this->followlocation);
curl_setopt($s, CURLOPT_HEADER, $this->includeHeader);
curl_setopt($s, CURLOPT_NOBODY, $this->noBody);
curl_setopt($s, CURLOPT_BINARYTRANSFER, $this->binaryTransfer);
curl_setopt($s, CURLOPT_REFERER, $this->referer);
if($this->authentication){
curl_setopt($s, CURLOPT_USERPWD, $this->auth_name.':'.$this->auth_pass);
}
if($this->post){
curl_setopt($s, CURLOPT_POST, true);
curl_setopt($s, CURLOPT_POSTFIELDS, $this->postFields);
}
$this->result = curl_exec($s);
$this->status = curl_getinfo($s, CURLINFO_HTTP_CODE);
curl_close($s);
还有个问题,用curl POST为什么是空白?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货