Fatal Error: Allowed Memory Size of 268435456 Bytes Exhausted (Tried to Allocate 71 Bytes)

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 71 bytes)

WordPress overrides PHP's memory limit to 256M, with the assumption that whatever it was set to before is going to be too low to render the dashboard. You can override this by defining WP_MAX_MEMORY_LIMIT in wp-config.php:

define( 'WP_MAX_MEMORY_LIMIT' , '512M' );

I agree with DanFromGermany, 256M is really a lot of memory for rendering a dashboard page. Changing the memory limit is really putting a bandage on the problem.

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 132120600 bytes)

In the beginning of your script you are using a dot instead of comma on date():

$numberDays = date('t'.$firstDayOfMonth);

While it actually should be:

$numberDays = date('t', $firstDayOfMonth);

This causes the while loop at line 34 to happens infinitely.

Allowed memory size of 268435456 bytes exhausted (tried to allocate 71 bytes) in /wp-includes/wp-db.php on line 2413

I have found the solution. The problem was caused by iThemes Security plugin. I turned it off and the errors have gone.

PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate XX bytes)

Modify your php.ini to increase your memory_limit to something higher than what you have currently provisioned – 512MB is not unusual for modern day applications.



Related Topics



Leave a reply



Submit