WordPress Fatal error: Allowed memory size exhausted

WordPress can encounter a white screen of death and most common reason is a PHP fatal error regarding allowed memory size exhausted.So we have decided to writeup on it because this is a very common problem.

There are many solutions but in this post we will share simple ones. 

First you want to edit your php.ini file with the following settings:

display_errors = On

Save the php.ini file and refresh your blank WordPress page and this time you will see an error.

Fatal error: Allowed memory size of 1048576 bytes exhausted (tried to allocate 122880 bytes) in /home/username/public_html/wp-includes/plugin.php on line 445

Simply locate the php.ini file into your public_html folder and modify the”memory limit” value with following settings:

memory_limit = 64M

Next open your wp-config.php file which is located into root WordPress directory,Then add the following line inside the main php tag:

define('WP_MEMORY_LIMIT', '64M');

Save changes to the file. Once the file is saved, the error should be gone.