Liz Banach Liz Banach - 2 months ago 16
PHP Question

WordPress - Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 130968 bytes)

I keep getting this error: Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 130968 bytes). This appeared when I was activating the new plugins necessary for a new theme in my WordPress website. I added the following code to my

wp-config.php
file:

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


However, after adding this code and doing a hard refresh in my WordPress administrative area the error message has not gone away. How can I fix this?

Rob Rob
Answer

Wordpress' WP_MEMORY_LIMIT only restricts the memory usage for the wordpress application. It doesn't increase the memory limit for php. So you still need to increase php's memory limit. You can do this in the php.ini or if you don't have access then add this to your wp-config

ini_set('memory_limit', '128M');