Tagged with " Wordpress"

How to fix the exhausted memory error in WordPress

Aug 12, 2009 by     13 Comments    Posted under: Productivity, Technology

Today, like any other day a wordpress update comes out, is a relatively painless procedure thanks to Keith Dsouza of Techie Buzz’s awesome WordPress Automatic Upgrade plugin. If you don’t already have this one installed in your arsenal, stop reading this and go grab it. This is perhaps the best plugin for wordpress by far, as it saves countless headaches of backing up the db, exporting, installing the new wp version, etc. etc. Thanks Keith!

October 13, 2010 Update: This article specifically applies to WordPress 2.x and lower, but the methodology still functions in WordPress 3.x. To fix the exhausted memory error in WordPress 3.x, follow the steps below, but this time, you’ll be modifying the wp-config file.

Open this file in your editor of choice (I use Dreamweaver)

Just after the < ? php tag, and before the / / **MySQL settings ** / / text insert:

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

Obviously, you can change this ’64M’ to any variable of 8 you’d like.

Right. Now that you’ve got Keith’s plugin installed, and upgrading you wordpress install is literally as easy as 6 or so clicks, you may or may not receive the dreaded ‘memory exhausted on line xyz…bla bla bla’ error. The error may refer to the kses.php file, class-simplepie.php file or any number of other variables. In your dashboard, you’ll most likely see something like this:

Oh Noes!

Yikes! That looks pretty nasty. But fear not, Captain O’ WordPress, it’s a relatively easy fix. Basically what’s going on here is that the server your blog is hosted on isn’t giving you enough juice to power everything that’s going on in your dashboard. Or rather, I should say, your wordpress installation isn’t telling the server to give you the required juice to make everything play nicey nice. Let’s go ahead and fix that bugger, shall we?

To fix the exhausted memory error:

1. Log in to your FTP client. I use Cyberduck to manage mine, but any FTP client will do the trick.

2. Locate the wp-settings.php file. In my installation, it’s hanging out in the main directory.

wp-settings

3. Download this file to your desktop, or anywhere else you want to store it, just remember where you’ve put it.

4. Open your code editor. I use dreamweaver, but as with the FTP client, any text editing software (even the one included with your OS) will do the trick.

5. On line 13 (shown below), you should see the text – define (‘WP_MEMORY_LIMIT’ , ‘32M’ ). Ah ha! Exhausted memory, memory limit….see where we’re headed with this?

32M-limit

6. Change this variable to anything higher than 32mb. I like to be on the safe side, and ask the server for double what the standard wordpress install calls for, and up it to 64mb.

64M-limit

7. Save the file

8. Upload the file back to its initial location

Click that dashboard button again inside your wordpress installation, et viola! Pretty text and all other goodies returned.

If you’re still having the exhausted memory error after following the procedures above, try upping the memory limit to 128mb. However, keep in mind, with 128mb you’re really pushing the limit on what your host will deem as ‘acceptable’ behavior from the one of perhaps hundreds of sites that are sharing the server with you. I’d recommend testing with 128mb, and upon ensuring this memory allocation solves your problem, try backing the usage down until you get the error again. If problems persist, you might want to open a support ticket with your host.

Problems or questions? Leave a comment below and I’ll do my best to help!

Latest Tweets

Video

flickr

Blue OrchidEmpty squares at empty tablesShowtimeDark ReflectionA Small WorldHoly Snail MailSwissGuardGoldenOpulanceGolden ArchesThe Main StageCircledAfterglowMagic LightPavedLast LightRound and RoundOculus