Elliott Rodgers

Working out life one day at a time.

Solving the Fatal Error: allowed memory exhausted problem

June 20, 2010 By: Elliott Category: My site

Part of the reason for moving my personal site over to WordPress was since I’m moving various sites onto a Virtual Private Server (VPS) from names.co and the fact I really fancied a change in design. It seemed a good time to bite the bullet and go for it. Within a couple minutes of installing doing a manual install of WordPress version 3 (which I really like a lot) at 5am on a Saturday morning (couldn’t sleep) I kept getting weird errors.

Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 3136 bytes) in ****/httpdocs/wp-includes/wp-db.php on line 958 (have obscured part of the server address for security reasons). Initially I suspected something had gone wrong with the WP3 installation but this didn’t seem to be true. Google is always handy in these situations so off I went to do some research. You should avoid the temptation to allocate a site too much memory since this may impact on other sites you have on the same server setup. (Some webhosts don’t allow you access to the php.ini file or to change memory allocations in which case you are going to have to use their tech support).

Altering your .htaccess file:
php_value memory_limit 32M

Alter your wp-config.php file:
define(‘WP_MEMORY_LIMIT’, ’32M’);

Alter your php.ini file: (if you have access to your PHP.ini file)
memory_limit = 32M ; Maximum amount of memory a script may consume (32MB)

Contact your webhost tech support team
sometimes all else fails and you need some advice, at names.co they are absolutely brilliant.

Leave a Reply

Before you make a comment (especially if you're thinking of spamming me) you might want to read this.

  • Who Am I?

    You Avatar I'm a 37 year old web developer, internet entrepreneur, amateur photographer and occasional poet.

    I live in South Buckinghamshire, Southern England with Sheppie, my five year old border collie.

    This is my website and blog. Please read my policy on Leaving Site Comments [Spam etc] before commenting.

    Thought For The Day

    They can because they think they can.
    ~Virgil

  • Find me on the web