I'm trying to upload data with POST to my webserver but sometimes cURL just stalls and causes PHP to use 100% CPU indefinitely.
I'm using the code below.
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $URL);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($curl, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)');
curl_setopt($curl, CURLOPT_HEADER, true);
$page = curl_exec($curl);
curl_close($curl);
Any insight to what is causing or how to track this issue would be great.