curl - PHP curl_exec() hangs -
i use function make curl requests:
function curl_request($options) //single custom curl request. { $ch = curl_init(); $options[curlopt_followlocation] = true; $options[curlopt_cookiejar] = 'cookies.txt'; $options[curlopt_cookiefile] = 'cookies.txt'; $options[curlinfo_header_out] = true; $options[curlopt_verbose] = true; $options[curlopt_returntransfer] = true; $options[curlopt_connecttimeout] = 5; $options[curlopt_timeout] = 5; curl_setopt_array($ch, $options); $response = curl_exec($ch); curl_close($ch); return $response; }
the script hangs sometimes, not always, on $response = curl_exec($ch)
line. occurs when php script set infinite timeout (on client side, firebug takes "aborted"). there nothing in error log.. doesn't past line when hangs.
what going on? suggestions?
the issue seems have been resources of server. when switched better web host higher bandwidth limit things worked fine.
Comments
Post a Comment