WordPress Fatal error: Allowed memory size of xxx bytes exhausted while upgrading WordPress

You might have received the error stating that “Fatal error: Allowed memory size of xxx bytes exhausted (tried to allocate xxxx bytes) in some-file.php on line xxx” while upgrading you WordPress version. The reason is that while executing PHP file, it exceeds allowed PHP memory on the server. Generally this happens if the value for memory_limit is set to low (probably 8M etc.) in PHP configuration file php.ini. There are some workaround to increase the value for PHP memory.

[1] You can contact your host to raise limit for php_memory.

[2] You can add following line in your .htaccess:

php_value memory_limit 64M

This will not work if suPHP is enabled on your server. If suPHP is enabled on your server then you will need to put php.ini in the root of your domain and modify the following line:

memory_limit = 64M ; Maximum amount of memory a script may consume (64MB)

[3] You can also raise PHP memory from wp-config.php file. Just add the following line after opening PHP tag:

define(WP_MEMORY_LIMIT’, ’64M’);

If the problem still persists, you can contact your host for further assistance.

Apart from this, if you are not using WordPress virtual cron (wp-cron.php) or any cronjob related plugins, you can disable it to reduce the resource usage on your server. You can refer our article on Disabling wp-cron.php in WordPress.

Leave a Reply