Solution to “Fatal error: Allowed memory size of 67108864/33554432 bytes exhausted”
Under Category: Helping, Tips & Tricks, WebMaster Stuff
This is a very common Error if you have a big site in WordPress. Mostly site with huge post count suffers in this error. It could occur while posting new or editing any existing post. I also had this error while creating large sitemap, doing some batch function. You will see any empty screen with the message below –
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 80 bytes) in /home/*****/public_html/wp-includes/wp-db.php on line 958
Or
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 80 bytes) in /home/*****/public_html/wp-includes/wp-setting.php on line 958
It occurs as WordPress tries to access more memory then its allowed to by “Server PHP configuration” or “WordPress Setting”. Increasing Memory will solve it. Here is solution for all user, who have shared hosting or dedicated or VPS, just FTP access to server will be enough.
Here is Solutions:
*** Here we consider 64M as good configuration. Depending on your need, server condition, how is your site, you could use 32M, 96M, 128M, 256M, 512M, 1024M, 2048M, 4096M. Make sure your server allow you to use that much dedicated memory.
1. Try adding this line to your wp-config.php file:
define(‘WP_MEMORY_LIMIT’, ’64M’);
2. If you have access to your PHP.ini file, change the line in PHP.ini
If your line shows 32M try 64M:
memory_limit = 64M ; Maximum amount of memory a script may consume (64MB)
3. If you don’t have access to PHP.ini try adding this to an .htaccess file:
php_value memory_limit 64M
4. Contact your web host support or the person manage your server.
Tags: Allowed memory size, fatal error, php memory error, wordpress solution, wordpress tips
24 Responses to “Solution to “Fatal error: Allowed memory size of 67108864/33554432 bytes exhausted””
Leave a Reply
2 Trackbacks/Pingbacks
- Tweets that mention Solution to “Fatal error: Allowed memory size of 67108864/33554432 bytes exhausted” | Asif.im -- Topsy.com
[...] This post was mentioned on Twitter by Haku Hadakhai, Rajeev Ranjan, tango, Gedi Dhakapute, Bigben Briton and others. Bigben Briton said: Solution to “Fatal error: Allowed memory size of 67108864/33554432 bytes exhausted”: This is a very commo... http://bit.ly/dlrTbH [...] - Windows Live Writer 500 Error & Wordpress (Fixed)
[...] of memory? What? After some searching I came across this article by Asif Rahman which listed 4 possible solutions, of which #1 fixed it for [...]

Its M Asif Rahman, Online Nick “Asif2BD”. This is my Main Blog. I am Founder & CEO Of
June 1st, 2010 at 10:20 PM
YOU ARE A GENIUS!!! THANK YOU!
June 4th, 2010 at 9:04 AM
Great information! I’ve been looking for something like this for a while now. Thanks!
June 7th, 2010 at 9:00 PM
Please, can you PM me and tell me few more thinks about this, I am really fan of your blog…
December 11th, 2010 at 12:15 PM
thank you, because I also need a lot to learn, continue to love her tips,,
December 13th, 2010 at 10:51 AM
hi… thank you, it works!!
I migrated my blog hosting, and I got the problem. It’s OK now…
- Chocky -
*regards from Indonesia*
February 17th, 2011 at 5:37 PM
Thanks a lot, This was very helpful I’ve change my php.ini memory limit to 512M and now it is running smoothly without getting the fatal error msg.
March 21st, 2011 at 6:42 PM
Thanks for your kind suggestion. This tip helps me to troubleshoot my blog.
Thanks again.
March 28th, 2011 at 2:51 AM
Thanks, the .htaccess solution worked for me
another nice tip for free hosting
April 17th, 2011 at 11:38 AM
i cant fnd the term
define(‘WP_MEMORY_LIMIT’, ’64M’);
in wp-config.php plz reply i am waiting
i am using wordpress 3.1.1
April 29th, 2011 at 2:14 AM
Thanks Mens
August 28th, 2011 at 8:13 AM
La solución para wordpress 3.0 que yo tuve que aplicar es la siguiente:
http://www.elabcd.com/2011/08/fatal-error-allowed-memory-size-of-33554432-bytes-exhausted-solucionado/
August 30th, 2011 at 3:48 AM
Muito Obrigado !
September 28th, 2011 at 5:34 PM
Thank you man… your help saved my time…
October 3rd, 2011 at 9:03 AM
Hi Mr Asif,
Thanks for the above recommended approach to memory
problem.My own problem is that i don’t have access to the blog when trying to FTP. Could you please
tell me what to do to have access to the config.php file.
Please iam new to the system.
December 24th, 2011 at 4:50 PM
Great….error now disappear…
January 4th, 2012 at 10:48 PM
Thanks very much. The perfect solution for Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 80 bytes) in /home/*****/public_html/wp-includes/wp-db.php on line 958
361 inedtrat
June 30th, 2012 at 12:02 AM
Hi. ok so my server only allows the use of 32mb of ram. is there a way to purge its memory ? like every 7 days kill all used memory ?
thanks
August 2nd, 2012 at 3:43 AM
I have this error;
Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 24 bytes) in…
is this mean 256MB not enough? or what?
January 11th, 2013 at 4:28 AM
Hi there,
I tried these instructions and it didn’t work. Only instruction I couldn’t follow was an update to the php.ini file, I couldn’t find it…
To get the error, I went to dashboard > users > screen options and changed the limit to view users from 200 to 999… I then got the dreaded message.
I have whm, so I upgraded the host package to utilise unlimited memory, this didn’t help either.
I followed these instructions and others to help:
1. Try adding this line to your wp-config.php file:
define(‘WP_MEMORY_LIMIT’, ’64M’);
I did this and also changed the suthentication keys, but this did not help
2. If you have access to your PHP.ini file, change the line in PHP.ini
If your line shows 32M try 64M:
memory_limit = 64M ; Maximum amount of memory a script may consume (64MB)
Unfortunately I could not find this file
3. If you don’t have access to PHP.ini try adding this to an .htaccess file:
php_value memory_limit 64M
This instruction took down the website….
I have contacted my host for help, but can only hope for the best…
January 27th, 2013 at 6:41 AM
After doing this I ended up with another problem. The white screen of death. Be careful guys when playing around with code. Back up the files you’re editing. I restored the backup, edited again and it was all fine.
January 28th, 2013 at 1:27 PM
it didnt work for me
April 22nd, 2013 at 12:32 AM
i have change it to 64 but still its giving error
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 868560 bytes) in /home/****/public_html/wp-admin/includes/admin.php
April 24th, 2013 at 7:29 PM
Hi! To your list of solutions I would add one more option: to edit the file .htaccess of the WordPress installation, adding the following line:
php_value memory_limit 64M
If necessary you can put 128M (that was my case).
This is the solution that worked for me.
Greetings!
April 27th, 2013 at 5:39 PM
Hi, tried all your solutions, but none of them worked.