Jun 20th, 2010 By Elliott
No Comments 

Solving the Fatal Error: allowed memory exhausted problem

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.

Similar Posts

  • Delicious
  • Facebook
  • Reddit
  • StumbleUpon
  • Twitter
  • RSS Feed
  • Digg

Got anything to say? Go ahead and leave a comment!