为什么我的CURL连接挂起?

时间:2012-01-18 09:30:55

标签: php curl

访问某些网址导致我的CURL连接挂起。知道为什么吗?

$curl = curl_init(); 
curl_setopt($curl, CURLOPT_URL, $_GET['address'] );  
curl_setopt($curl, CURLOPT_HEADER, FALSE);
curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1)');
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 2); 
curl_setopt($curl, CURLOPT_TIMEOUT, 5);
$str = curl_exec($curl);
curl_close($curl);    

0 个答案:

没有答案