I have this simple php script that contains only the following lines
$mem = memory_get_usage()/1024; $mem = $mem/1024; echo "mem: ".$mem ."Mb<br>"; $max = ini_get('memory_limit'); echo "max is $max<br>"; $filename = 'upload/orig/CID_553.jpg'; $filesize = (filesize($filename) / 1024); echo "filesize is $filesize Kb<br>"; $img_pointer = imagecreatefromjpeg($filename);
At startup, I get this output
mem: 0.30711364746094Mb max is 64M filesize is 952.2666015625 Kb Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 13056 bytes) in C:\temp_checkmem.php on line 13
How is it possible that downloading a file from 952Kb will force PHP (imagecreatefrompeg) to go to the allowed 64Mb of memory? Any ideas?
source share