How to Fix Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 42 bytes)

How to Fix Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 42 bytes) This page contains information about How to Fix Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 42 bytes) Here you can also

A customer complaint about getting an error on their website:

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to
allocate 42 bytes) in
/var/www/web1/web/forums/includes/adminfunctions_template.php on line
2214

Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to
allocate 16 bytes) in
/var/www/web1/web/forums/includes/class_core.php on line 2868

 

The Basics: Run a phpinfo file to display the configurations in the php.ini file.

look at where it says memory_limit - It will mostly like say 8MB which is the default.

Now edit your php.ini file to 20MB. Restart your httpd (apache) server.

If this doesn't work, you will have to edit your script ad put this code at the very top:

ini_set("memory_limit","20M");

 

Hope this helps

WARNING: Always make a backup of the php.ini file before you begin to do anytning like this
8845 - Sat Feb 02, 2013 22:11:24