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

Popular posts from this blog

php - How can I edit my code to echo the data of child's element where my search term was found in, in XMLReader? -

jQuery Ajax Render Fragments OR Whole Page -

java - Why is BlockingQueue.take() not releasing the thread? -