Today I added a new feature in the content management system I'm building. Depending on where you are uploading an image to, PHP will resize the image to fit the designated location. It works quite well, but when I try to upload a larger image, as in a 3MB image, I'm getting a fatal error:
Fatal error: Allowed memory size of 134217728 bytes exhausted
(tried to allocate 42520 bytes) in...
I'm thinking 128MB of memory is quite a lot, considering I don't run that much... at least I don't think so. It tried to allocate another 42520 bytes for the resizing process, but failed.
My question is should I (A) increase the limit or (B) re-evaluate why I'm using so much memory in the first place? Is 128MB a good number or is it too large/too little?
Thanks, Ryan
RESOLUTION
I concluded that 128MB is really too much for resizing an image and I was so focused at looking at other options... like exec() options, that I never took a closer look at my "sample" data. Turns out, that even though my large image was only 2.83MB, it was OVER 10000px wide. That's a problem. :)