WordPress, Fatal error: Allowed memory size of 33554432 bytes exhausted

Danger Will Robinson
Dur­ing a rou­tine update to a Word­Press site we received the fol­low­ing error: Fatal error: Allowed mem­ory size of 33554432 bytes exhausted (tried to allo­cate 7680 bytes) in /home/website/public_html/wp-includes/functions.php on line 1342 Scary stuff, but no need to panic. Chances are your Word­Press install is quite well used with lots pages, posts, and plu­g­ins. First off, don’t start dis­abling plu­g­ins and hack­ing code. Fol­low these sim­ple steps and you’ll be updated in no time.

Please be sure to fol­low this one peace of advice, bypass­ing this one step could cause you untold hasle. Word­Press has matured into an amaing prod­uct, a prod­uct that no longer requires us to man­u­ally trans­fer files. So any files you main­tain locally will be quickly out­dated. So please before imple­ment­ing a fix like the one here, down­load the lat­est ver­sion of that file from your server. Always cover your bases.

The first thing you should look at is the “wp-settings.php” file, located in your root direc­tory. in the root of your install. In some instances this code likes to hide in “wp-config.php” instead of “wp-settings.php”. Chances are you code looks some­thing like this.

1
2
if ( !defined('WP_MEMORY_LIMIT') )
	define('WP_MEMORY_LIMIT', '32M');

In this case we would change the mem­ory limit from 32M to 64M. Upload the file to your server, and attempt the update again. Chances are your good to go at this point.

But if you don’t see a mem­ory limit in your “wp-settings.php” or “wp-config.php” files, or in the rare case that you did change it and it still didn’t work, you’ll need to look at your “php.ini” file, also located in the root of your install. In the “php.ini” file you’ll be look­ing for the following.

1
2
3
4
5
6
7
8
< ?php
ini_set('memory_limit','32M');
/**
* WordPress Installer
* @since unknown
* @var bool
*/
define('WP_INSTALLING', true);

Again you’ll be chang­ing the mem­ory limit from 32M to 64M. Upload the file to your server, and reat­tempt the update.

In the rarest of rare cases, the mem­ory limit has also been known to reside in the .htac­cess file. Again, this file is located in the root install direc­tory. Only if you see the fol­low­ing code, should you change it.

1
php_value memory_limit 32M

Again you’ll be chang­ing the mem­ory limit from 32M to 64M. Upload the file to your server, and reat­tempt the update.

A word of warn­ing. Be sure to backup all your files before mak­ing these changes. Alter­ing any of the files men­tioned in this post with­out at least a basic under­stand­ing of server func­tions, and php, can lead to “Really Bad Things”. We are not respon­si­ble for any dam­age or lost info. But if you fol­low our direc­tions closely, and backup your files, you shouldn’t run into any problems.

Did this post help you? Let us know with a com­ment. Thanks for stop­ping by.


Was this article helpful? Here's a few related articles which may also interest you.

Related Posts:


4 Comments to “WordPress, Fatal error: Allowed memory size of 33554432 bytes exhausted”

  1. Isabel says:

    Much needed infor­ma­tion. Thank you very much. :)

  2. […] of mem­ory speed, an arti­cle we wrote a few moths back may also inter­est you. In the arti­cle titled Word­Press, Fatal error: Allowed mem­ory size of 33554432 bytes exhausted We describe how to increase the mem­ory alo­cated to […]

  3. mlb jerseys says:

    Thank you for Post­ing & I got to read nice infor­ma­tion on your site.

  4. reg says:

    really appre­ci­ate YOU — thanks a lot!

Leave a Comment