Image manipulation is a memory-heavy task. Are the images you're having trouble with very large? Not in terms of filesize, but in terms of pixel density (e.g. > 2000x2000px)? Take a look at this: http://www.dotsamazing.com/en/labs/phpmemorylimit And mind, that you need some more memory for your application itself.
intervention/image hitting php memory_limit
Hi guys, I don't usually post looking for help as I can usually find a solution by searching, but this one's got me stumped.
I am building a website which allows the user to upload multiple images and then on the server I use intervention/image to resize and save them. This has been working fine on my vm but when I run it on the server it sometimes hits the memory_limit.
I have logged the memory usage in the code at every stage and on the vm it uses about 20mb average all of the time. On the server it often works, but sometimes it suddenly spikes to 70mb and then throws the error that memory is exceeded.
I was wondering if anyone else has had this problem, or knows of a good way to debug what is causing it to hit the memory_limit with some files. The strange thing is that it will always cause an error if i pick certain files, but then if i add a certain other image file with the others it works just fine, which doesn't seem to make sense since it's more images then.
Hopefully this makes sense and I'd appreciate any advise I can get right now!
Please or to participate in this conversation.