I use curl to perform a HTTP request like this:
$ch = curl_init(); $timeout = 5; curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1)
you can check error number and its' description like this:
// Check if any error occurred if(curl_errno($ch)) { echo 'Curl error: ' . curl_error($ch); }