I'm debugging a sudden issue on a client site where we need to get the dimensions of some images. The getimagesize() is not working anymore, it just spins and spins forever. Not sure what the issue is. I see ALLOW_URL_FOPEN is on in php.ini so that shouldn't be the issue.
I try switching to cURL to get the size that way. Like so:
$headers = array(
"Range: bytes=0-32768"
);
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_TIMEOUT, 15);
$raw = curl_exec($curl);
curl_close($curl);
$img = imagecreatefromstring($raw);
$width = imagesx($img);
$height = imagesy($img);
return array(1,1);
And here cURL is doing the same thing, forever loading a white screen with no indication of what error it is. Even with the timeout. Also function_exists('curl_init') is true as is extension_loaded('curl').
What could be wrong? It's probably server related but I'm not sure where to look next.