Quantcast
Channel: Crunchify
Viewing all articles
Browse latest Browse all 1037

How to fix Fatal Error: Allowed Memory size Exhausted WordPress error? Increase PHP memory_limit

$
0
0

Sometimes based on your hosting provider and wrong PHP setting you may get similar error like this:

Fatal error: Allowed memory size of 32349183 bytes exhausted

How to solve this PHP fatal error?

First let’s 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, 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.

Solution-1

Open wp-config.php file and add below line to file.

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

Solution-2

  • Using cPanel. Click on Click on Switch to PHP Options link.
  • Look for memory_limit key and increase value to 1G.

 

That’s it. 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.

The post How to fix Fatal Error: Allowed Memory size Exhausted WordPress error? Increase PHP memory_limit appeared first on Crunchify.

Author: App Shah

Crunchify, LLC Logo


Viewing all articles
Browse latest Browse all 1037

Latest Images

Trending Articles



Latest Images