@freel did you restart fpm service after you changed the limit? look at php_info() and see what it says
Intervention/image memory_limit
Hello team, I need your help. 4 hours tying to understand one thing. I am using Intervention/image memory_limit I have 128M
Problem is that when I am trying to open file. I am getting error 500.
$file_name = $request->file('myImage');
Image::make($file_name)->resize(300, 200)->save('foo.jpg');
As I understand We a running out of memory. PHP error log: [07-Apr-2016 22:41:10 UTC] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 21248 bytes) in /Users/Freel/Desktop/Web/project22.dev/vendor/intervention/image/src/Intervention/Image/Gd/Decoder.php on line 114
Question: I found somewhere in google that memory_limit can be max 128M, so how to solve this issue? how to make this library work?
Image files I am trying to convert is 5mb. Thanks
@freel I used this package in the past for an online image resizer and I had problems with memory limit too, I solved it with this simple line of code
public function resize(){
ini_set('memory_limit','256M');
# Do your Intervention/image operations...
}
As I remember, I didn't need to configure anything else. Maybe it's not a memory limit problem, but a file size limit. If you want, try to upload your image in my resizer app and tell me if something went wrong, otherwise try the method above.
Please or to participate in this conversation.