image icon indicating copy to clipboard operation
image copied to clipboard

Cannot process large image, server return 500 error

Open blu94 opened this issue 7 years ago • 6 comments

Inpect the error return empty page, here is my code:

$img = Image::make(public_path($name))
        ->resize(320, 240)
        ->save('/assets/', $file->getClientOriginalName());

image image image

blu94 avatar Feb 13 '18 10:02 blu94

I'm also getting same error. The strange thing is that it's working for 10mb sized image but giving error on 5mb sized image.

memory_limit=2048M
$img = Image::make($originalFilePath);
$img->resize(intval($width), intval($height), null,
                function($constraint) {
                    $constraint->aspectRatio();
                });
 $destinationPath   = public_path('app/photos/thumbnails');
 $photoName         = explode('photos/', $filename);
 $img->save($destinationPath.'/'.$photoName[1]);

Error occurring on Image::make;

umairm638 avatar Feb 15 '18 08:02 umairm638

Following file is the one which is not uploading.

aahhaaa

umairm638 avatar Feb 15 '18 08:02 umairm638

@blu94 have you figured out this issue?

umairm638 avatar Feb 19 '18 09:02 umairm638

@umairm638 i include this code, ini_set('memory_limit', "2000M");, enhancing the memory limit using php ways. It work in localhost, but i don't think this code will work on godaddy share hosting. normally share hosting RAM is 512M, i tested with set the memory limit to 512M, it is not working, it only work when 1000M or higher.

blu94 avatar Feb 26 '18 03:02 blu94

This is real problem. I use another image library with the same Image, and it works fine.

neobie avatar May 31 '19 14:05 neobie

This is real problem. I use another image library with the same Image, and it works fine.

which library?

SefaDedeoglu avatar Jan 11 '22 14:01 SefaDedeoglu

This is real problem. I use another image library with the same Image, and it works fine.

what libraries are you using?

naufalshoeria5 avatar Jan 12 '23 04:01 naufalshoeria5

Sorry too long to recall. If not mistaken, gumlet php image resizer.

neobie avatar Jan 09 '24 07:01 neobie

Increasing memory limit and switching from imagick driver to gd solved it for me.

sarik-k avatar Apr 10 '24 09:04 sarik-k

Increasing memory limit and switching from imagick driver to gd solved it for me.

Sorry too long to recall. Yes its the problem you can increae memory limit and timeout time and it will be fine

SefaDedeoglu avatar Apr 22 '24 07:04 SefaDedeoglu

Hi, is this error coming up on live server or localhost? You need to increase the limits set in the php.ini file, this worked for me.

php.ini edits needed for server max_execution_time = 360 max_input_time = 360 memory_limit = 2048M extension=php_imagick

You can go as much higher but this works for some intense image manipulation that takes 3 minutes or more, also it can be server limits so in my case I had to increase the amount of RAM used on Digital Ocean.

danielthomascarr avatar Apr 22 '24 07:04 danielthomascarr