Home >Backend Development >PHP Tutorial > curl数据交付 在nginx中出错

curl数据交付 在nginx中出错

WBOY
WBOYOriginal
2016-06-13 12:46:51995browse

curl数据提交 在nginx中出错
请问: 
curl方法数据提交,在apache服务器运行,没有任何问题。 
在nginx服务中,curl_exec($ch)执行结果为false,且只有等到timeout后,该php才会停止执行,否则一直处于刷新状态。 

nginx.conf该怎么配置,才能解决此问题。 谢谢 

$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL,'http://192.168.247.138:8181/a2.php'); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
curl_setopt($ch, CURLOPT_TIMEOUT, 3);
$data = curl_exec($ch); 
curl_close($ch); 
var_dump($data);
?>

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