PHP Fatal error: Allowed memory size of 33554432 bytes exhausted
by Gabi SolomonPHP Fatal error: Allowed memory size of 33554432 bytes exhausted
This is an error that seem to puzzle most beginners, so i will try to explain what this error is all about.First lets understand why this is happing, there are a few reasons why your getting this error:
- the output of your is very large
- your script grabs over the 8MB default memory limit of PHP ( maybe from POST FILES variables )
- there’s a bug in your script that is causing the script to eat that much memory
Now dont get scared its not a big deal, and usualy its a easy fix
. To solve this problem you should try to:
- optimize your script so that it will not eat up the maximum memory limit
- find bugs (memory leaks) in your script
- minimize the output of your script
- increase the memory_limit setting in php.ini or directly in your php script by using the ini_set() function
This 8MB default limit is coded in php to stop any script from taking to much memory out of the server and maybe crashing it. This is way the best method of dealing with this error is to figure out what is causing the need for this much memory and reducing it, rather then going for the easy way out and increasing the limit.
Hope this helped you and i await your comments

