I am getting a memory error:
Fatal error: Out of memory (allocated 67633152) (tried to allocate 19104 bytes)
I've done a ton of research. I tried to increase memory limit on php.ini to 256M and checked that with phpinfo() to verify it had changed. This did not work.
My image is a big one at 9.6M with 4776px × 2856px res. I know that uploaded images get bloated up to around possibly: 4776x2856x3 = 40M+. But this is well below the memory limit of 256M. I have even tried with a set memory limit of 10000M. This did not work either.
I uploaded other smaller images that worked fine but then retried the big image with no success and no change to error message.
What is my next step?
Here is a slimmed down version of my upload code:
foreach(array_keys($FILES['name']) as $KEY) {
if($FILES['type'][$KEY] === 'image/jpeg') {
$TEMP = imagecreatefromjpeg($FILES['tmp_name'][$KEY]);
} else if($FILES['type'][$KEY] === 'image/png') {
$TEMP = imagecreatefrompng($FILES['tmp_name'][$KEY]);
} else if($FILES['type'][$KEY] === 'image/gif') {
$TEMP = imagecreatefromgif($FILES['tmp_name'][$KEY]);
} else {
die(); }
$HD = $KEY.'.jpeg';
imagejpeg($TEMP, $HD, 100);
imagedestroy($TEMP);
}
Here is my php.ini
INPUT:
post_max_size = 1024M
upload_max_filesize = 1024M
max_file_uploads = 200
memory_limit = 1024M
max_execution_time = 259200
max_input_time = 259200
session.gc_maxlifetime = 1200