Home / Programming / php / How do I get rid of "Fatal error: Allowed memory size of 8388608 bytes exhausted" in my php scripts?
How do I get rid of "Fatal error: Allowed memory size of 8388608 bytes exhausted" in my php scripts?
Last updated: 02/07/2012
This means your php
script has run out of memory, but you can usually increase the amount of memory available, directly in the script. Just add this line to the top of your script:
ini_set("memory_limit","12M");
This increases your allowed memory to 12 MB, just for the duration of the script. Most hosting providers won't allow you to permanently alter that number, but this should solve the immediate issue.