I started facing problems of White Screen of Death (WSOD) problems and Blog slowing down after upgrading my Blog to Wordpress 2.8. I was able to resolved them.
But, started facing the following problems recently :
- Encountering “Wordpress Fatal error: Allowed memory size of xxx bytes exhausted” when trying to do Automatic Upgrading of Wordpress
- “Wordpress Fatal error: Allowed memory size of xxx bytes exhausted” appearing in the Wordpress Dashboard
What does Error mean ?
Wordpress runs on PHP. It means though the error you are getting is on your Wordpress Blog. But, it is related to PHP Error
You get this kind of error “Wordpress Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 16842 bytes) in wp-db.php on line 501″
The above is the error i was getting in the Wordpress Dashboard
Reason for this “Wordpress Fatal error:”
The reason is simple. Your Wordpress blog is overloading your PHP with lots of instructions and thereby exhausting the memory.
Therefore, This is an memory issue. It can be solved easily by changing some Wordpress Core file.
How to solve “Wordpress Fatal error: Allowed memory size of xxx bytes exhausted” Error
Below, is the best possible solution to resolve the issue. I have personally done this for this Blog. You will be changing two files php.in and wp-settings.php
Before you change modify files mentioned below, Please take a back up of it!
- Login in your host provider website and click File Manager.
- Try to find
php.inifile on the root of your site. Mine was located inpublic_htmlfolder. - Open
php.iniin any editor they support. Look for "memory_limit" (without quotes)memory_limit = 32M ; Maximum amount of memory a script may consume (32MB)
You should find a line similar to the one above.
- Try to increase the Number by multiplying by 2. For ex: if your php.ini shows 16M then try changing 32M.
In my case, i changed it to 64M.
Here we are telling PHP to use 64M of memory instead of 32M.
- Save the file and close the editor
- Now move to your wordpress directory and look for
wp-settings.phpfile and open in File Editor - Look for the following two lines
if ( !defined('WP_MEMORY_LIMIT') ) define('WP_MEMORY_LIMIT', '32M'); - Once you find it, Try changing it to the number that you have changed in
php.iniin the above steps. In my case i changed the second line to 64MHere we are trying to increase the Memory usage of Wordpress by telling Wordpress to use 64M instead of 32M by modifing it in wp-settings.php
Remember : You will need to make the above change to
wp-settings.phpafter you upgrade the Wordpress. As these changes will be overwritten by new file - Save the file and close the editor
Now, you are done. Try loading Wordpress Dashboard page or any Wordpress page where you were getting "Wordpress Fatal error: Allowed memory size" error. Most probably, you won't see it.
I was able to solve it.
Hope you can also solve/fix Wordpress Fatal error: Allowed memory size of xxx bytes exhausted
If you find this information helpful, then do give your thanks and also suggestions or other tips you know via Comments!
|
1921 readers are already subscribed to this blog! Why don't you be one of them? Subscribe to this blog via your favorite RSS feed reader or by entering your email address on the form below: |
You Should Also Check Out These Posts:
- How to Remove Wordpress Meta Generator tag
- Planning to change Wordpress Theme?
- Blog slowed down after upgrading to Wordpress 2.8
- How to Add categories to Nav Bar
- How to add Comment Link in Single Post – Wordpress


Subscribe
This will work just fine but I am a bit concerned about making any changes to the core files. You could end up having to repeat your changes every time a new version of WordPress is released.
You could add the following line to the wp-config.php file:
define(‘WP_MEMORY_LIMIT’, ‘64M’);
This file is not overwritten when you upgrade WordPress. Not all hosts will allow this but in this case this setting will do nothing and the default of 32M will be used.
@Lyndi, I will check whether addding it in wp-config.php gives the same result. If it gives, then your suggestion is very good.
damn it , you have a nice tips here . i will copy this tips to my notepad . thanks
@earningstep, Thanks. I am glad that you liked it. I hope it will help you if confront with this kind of error in future.
I never had an error like this, thanks for the tips, they might help if I face it in future
@Best CSS Gallery, Hope it helps you…
I have faced this problem but I replaced my function.PHP file using FTP then error was removed.
But before all things Blog backup is necessary part.
@Surender Sharma, I didn’t get you what did you do? Can you elobarate
Luckly never had this error. I will remember for future , if I face this problem. Thanks for sharing .
@Ruchi, Hope you won’t face this situation.
thanks for the solution!
@jade, you are welcome
Luckily i have not faced this error so far. Bookmarking this post as it might come useful in the future
@Madhur, I have faced. Happy that you didn’t face it. Thanks for bookmarking.
HI Nihar,
just got this error on my blog admin tried this tip but didnt work so submitted a ticket with my host
Thanks
Heeren
@Heeren, May be your host doesn’t allow you to change memory settings. Hope they can resolve it.
[...] Therefore, This is an memory issue. It can be solved easily by changing some Wordpress Core file. ?from?niharsworld? [...]
I ran into this problem today, and your post was a lifesaver (metaphorically speaking)! Thanks!
Greg, I am glad that my post helped.
[...] issue, I found an extra help that may aid you if the above steps don’t work. Thanks to Nihar’s World for the tips! Look for steps 6, 7 and [...]
Hi,
I got the same problem, but when I opened my php.ini file, the memory_limit line is not there!!! I checked extensively for information on that and everyone says the same thing, but I dont understand why my php.ini file has no memory limit??
Well, keeping that aside…What I did was I added the memory_limit line to 96M and the rest of the changes I made in the wp-settings file just as recommended.
I am not getting the fatal error now, but My Thesis Options wont load!! I mean If I make changes in Thesis Options, It takes for ever to reload and when it does…the changes are not made!! I am very confused now and also worried
Can you help me out of this fix!! please