Sometimes based on your hosting provider and
wrong PHP setting you may get similar error like this:
Fatal error: Allowed memory size of 52349183 bytes exhausted
How to solve this PHP fatal error?
- Fix PHP fatal error
- How to increase PHP memory limit?
- WordPress increase memory limit to 1GB
understand why we are getting this error. Sometimes in order to load page WordPress has to load some of the objects into the memory. Like, post data, references, WordPress hooks information, and lot more. Everything is handled by PHP in memory. Now, while loading a specific page request, if PHP doesn’t have
enough memory to store all of these data then page will crash and throws
fatal error saying, Allowed Memory size Exhausted.
This is not a good scenario for your users. Solution is very simple.
wp-config.php file and add below line to file.
define( 'WP_MEMORY_LIMIT', '1024M' );
cPanel. Click on Click on
Switch to PHP Optionslink.
- Look for
memory_limitkey and increase value to
1G is enough and you shouldn’t see any memory exhausted error any more. I would suggest avoid modifying
php.ini file because if you messed up with it, your
whole site won’t load until you fix it.
cPanel method is the best, recommended and right way to increase
php memory limit.