Forum
PHP Fatal Error: Allowed memory size exhausted
Started getting a 500 error in my browser when trying to upload a new image to a blog post. There is some processing on the image (size, quality & density) so that when I submit the changes on the post after adding the new image, the browser goes to 500 error.
Server error below:
[Sat Oct 08 02:39:19 2016] [warn] [client 82.10.153.200] mod_fcgid: stderr: PHP Fatal error: Allowed memory size of 103809024 bytes exhausted (tried to allocate 15360001 bytes) in /nfs/c12/h04/mnt/213490/domains/chase-erwin-dev.com/html/perch/core/lib/PerchImage.class.ph p on line 726, referer: https://chase-erwin-dev.com.s213490.gridserver.com/perch/addons/apps/perch_blog/edit/?id=1
I've tried increasing my php limits on the server which did not solve the problem and I have contacted Media Temple who believe the issue is with the CMS, see their response below:
Thank you for contacting Media Temple!
It appears that this PHP process is exceeding the 99MB memory limit, the error message shows 103.809 megabytes exhausted. In this case upload size does not appear to be the issue, but rather the PHP process being run by the CMS is exceeding the PHP memory limit value. We recommend disabling high usage plugins/themes to reduce overall memory usage to avoid this error. For optimization we highly recommend contacting a developer for your specific Content Management System for further assistance.
How large is the image, and how many size conversions are you doing?
The original image is only around 300K, and the weird thing is I have successfully processed a lot larger images already this morning.
My content tag is
width="1200px"
should bewidth="1200"
My bad, unfortunately the problem still persists.. Although, having tried adding a different image to the same post, there is no error. It appears the error only relates to adding this one particular image, same if I try to add the offending image to a different post. Any idea?
An image can be complex and require a lot of memory to resize it without appearing overly large. PHP is resizing the image, this isn't a process that Perch can optimize.