Laravel 5.2 Intervention Image 500 Server Error

后端 未结 5 1901
青春惊慌失措
青春惊慌失措 2021-01-11 17:46

When I upload big images (4.2 MB) Intervention Image is throwing 500 Error...

private function resizeImage($path, $imgName){
    $sizes = getimagesize($path.         


        
5条回答
  •  醉梦人生
    2021-01-11 18:34

    I had the same problem with Laravel 5.1 and Intervention Image library. In my case the issue came from the line Image::make($file) not the upload part.

    I tried change the values of:

    • upload_max_filesize from 2M to 32M
    • post_max_size from 2M to 32M

    Change nothing to the error I received.

    So I increase :

    • memory_limit to 256M

    It solved my problem. My hypothesis is that even if my image was about 6Mo, the image library needed a lot of memory to use it.

提交回复
热议问题