How to Resolve Fatal Error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 30720 bytes)
Recently, when either adding new plugins or upgrading plugins in Wordpress, I encountered this error message:
Fatal Error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 30720 bytes)…
This means that Wordpress needs more memory to run a process than the default PHP setting (usually 12M, in some, 32M). For a non-techie guy like me, the error is frustrating, and very alarming.
Before you panic, there are actually simple solutions to this problem that even a non-techie person can do. The first solution is the “standard” or proper way to resolve it, however, it depends whether you have access to the file that needs to be updated. The second one is much easier, a “hack” to a specific Wordpress file, however, you may need to do it again everytime you perform a Wordpress upgrade.
Solution 1: Modify your php.ini file
The PHP.INI file can be found in your root directory, usually in /public_html/ directory. That is if your hosting provided you an access to it. In my case, I am using Bluehost/Hostmonster, and it provides you the ability to copy the PHP.INI to your /public_html/ directory then you can make the necessary modifications. Open PHP.INI file and -
Find:
memory_limit = 12M
… change to 32M or higher
Before the new settings could take effect, it “maybe” necessary to restart your webserver.
Solution 2: Add code to your Wordpress /wp-admin/install.php file.
Using your hosting file manager or FTP tool, open your /wp-admin/install.php file and add the following code directly under the <?php tag (usually at the top of the file):
ini_set('memory_limit','32M');
The updated /install.php file should look like this:
ini_set('memory_limit','32M');
/**
* WordPress Installer
* @since unknown
* @var bool
*/
define('WP_INSTALLING', true);
Solution 3. Add this line of code in your Wordpress WP-CONFIG.PHP file. Add it before any other values. (My preferred choice)
define('WP_MEMORY_LIMIT', '64M');
Try to increase it to 64M if 32M seems to be insufficient. These solutions can also be applied to other PHP-based programs and not just Wordpress.
Did you find this useful? If you think there is a need to modify some of the codes or information on this article to make it more meaningful and helpful, feel free to leave your comment and corrections/updates will be made accordingly.
It will be greatly appreciated.

































































I just had a plugin error that’s why I am not around for sometime now.
Thanks for the added info..I’ll be back soon once my bloggy errors ends.
Snow´s last blog post..‘Fantasy Island’ Star Ricardo Montalban dies at 88
Reply
bloggista Replies:
January 20th, 2009 at 6:32 pm
ohhh, what errors? Let me know if you need some help.
bloggista´s last blog post..Filipino honored for inventing low-cost stove
Reply
Same problem i have. It was my Chinese Consultant who fixed it. http://www.kotsengkuba.com and I think he blogged it under http://www.blog-almighty.com hahaha
Reply
I’ve the same problem!
Thanks, that fixed it for me.
Reply
Thank you so much. I had this issue on 2 of my sites, and this resolved it quickly. I am gonna digg this so other people can find a solution quicker
Reply
Thank you, found this post on google, you saved my life hahahaha…
Reply
Pinoy Jobs Online Replies:
September 15th, 2009 at 10:46 am
Glad to be of help!
Reply
Thank you so much for posting this, I didn’t think I’d find anything about this specific error.. I’m really glad you posted these solutions. Increasing the memory limit by editing the install.php worked well for me.
Reply
I tried the Solution 2…but it doesn’t worked for me…
What should i do now?
Reply
bloggista Replies:
November 9th, 2009 at 12:27 am
have you tried Solution 3? Should work in most cases… And make it 64M…
Reply
Thank you so much for post it has already fixed a couple of blogs of mine, I’m not really into the code but you showed the how and where to make the changes so that even a code idoit like me could fix it thanks again.
Reply
thanks i was looking for this thing only.
Reply
Thanks for this post. It gave me the direction I needed to resolve the issue. Your post explained the issue clearly so that I knew where to look for the problem. My php.ini file was already set to 32M but a particular plugin needed a little more. I edited the memory limit to 64M, updated the plugin, and then set the limit back to 32M. 32M seems a reasonable limit for most scripts. Thanks again.
Reply
thank you so very much. Solution number three did the trick for me when trying to upgrade my WordPress installation.
Reply
Fantastic!!! Many Thanks
Reply
Thank you! The wp-config.php worked for me.
Reply
Solution 3 worked well for me!… should we change it back after the upgrade [ie, remove the "define('WP_MEMORY_LIMIT', '64M');" from the wp-config file once we've upgraded]? Or does it matter?… could it have a negative impact on the site in any way if we left it there?
Reply
bloggista Replies:
January 5th, 2010 at 8:16 pm
Hi Chris, great to hear it worked well… Solution 3, being my preferred choice as well, is safer and only affects wordpress install, and not the entire account (if you happen to have multiple domains in you account). There is no problem if you leave it as it is… So you don’t have to do it all over again when new upgrades are released.
Reply
Thanks for this bloggista. Good thing I saw your article via google search. I also have this error on my Wordpress Dashboard. Hopefully, I’d be able to fix this using your solutions.
Reply
bloggista Replies:
February 1st, 2010 at 3:39 pm
Hope this one fixed your problem dude. Thanks for the visit and for the comment. More power to you!
Reply
Solution #1 did not work for me (I also use Bluehost and I changed the php.ini file as instructed, but this did not solve the problem. Maybe like you said, the server needed to be restarted or something? I did not know how to do that or how to request bluehost to do it.
Solution #2 worked for me. It is also explained on the wordpress website at http://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP
Thanks!
Reply
Let me add my thanks to the several ones already here. Solution no. 3 did the trick for me.
Best,
I.
Reply
Thank you! The wp-config.php worked for me.
Reply
Thank you, the third option finally fixed those errors for me, cheers!
Reply
For some reason, I couldn’t find those specific lines of code in any of those three files. I found instructions from WP to edit a different file, and it worked.
Here:
http://codex.wordpress.org/Editing_wp-config.php#Increasing_memory_allocated_to_PHP
This help file recommends making sure that wp-config has the same allocation…except there was no memory limit defined in my config file. Maybe it’s a newer version?
Reply
Solution #3 worked for me as well. The first two led to further errors for some reason, but after going through all of your solutions, things seem to be working better than ever.
Thank you so much for taking the time to share this information!
Reply
thanks!! i went for solution nº 3 and it worked pretty easy!
thanks again.
Reply
Thanks for the workaround. Solution #3 worked for me. When I tried #2 I got another error message about a http.php file.
Anyway, thanks so much.
Happy Blogging!
Kia
Reply
I want to add my thanks. Following the lead of other commenters, I just tried Solution #3 first off. Worked like a charm.
I shared your post in Google Reader, and will tweet. Interesting blog, BTW.
Reply
bloggista Replies:
February 1st, 2010 at 3:41 pm
Thank you for the comment alaJoAnn. You’re welcome.
I should update this post to immediately highlight Solution #3 especially for Wordpress users.
Reply
Valuable info. It’s so great to have access to an answer before I have the problem.
I love how your blog shows up on my iPhone. Did you use a plugin or some special coding?
Reply
Wow it feels good to hear in one way or another this post helped. Thanks for the visit and for the comments.
Reply
thank you soo much! its now working!!!!
Reply
Thank you for this fix, easy to do and your instructions were invaluable! Normally wouldn’t take time to comment, but let this be a testament to my relieved frustration!
Reply
Thanks so much! This fixed my problem with the e-commerce plugin I was installing.
Renee
Reply
I couldn’t get wp e-commerce to work until I did solution three for 128MB.
Thanks for giving back to the Internet by posting this information!
Reply
More details:
WordPress 2.9.1 and WP Shopping Cart (AKA WP e-Commerce) 3.7.5.3 was giving me:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 30720 bytes) in /home2/lancerki/public_html/wp-content/plugins/wp-e-commerce/merchants/library/googlerequest.php on line 701
And I resolved this by using steps 1 AND 3 mentioned in the blog with a setting of 128MB. I’m not certain step 1 was necessary. Step 3 seemed to fix it all.
Reply
#3 worked for me. Thank you so much!
Reply
[...] How to Resolve Fatal Error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 30720… saludos! __________________ MixConsolas – Tu portal de videojuegos | Club de Juegos Nintendo | Google Chrome Blog Subasto TeknoAdictos.net – 6.5$ ! [...]
Thanks for this. Not sure which solution worked, because I tried all three. But everything’s running like normal now.
Reply
bloggista Replies:
February 23rd, 2010 at 9:13 am
If you are using wordpress, better use SOLUTION 3. Edit the wp-config.php…
Reply
Thank for the info. Warning… when you edit the wp-config.php make sure you edit it using your hosting company (hostmonster/bluehost)or using a nice editing software coz you might end up messing up the code, like i did, using notepad through filezilla. To be on the safe side edit through your hosting account.
Reply
bloggista Replies:
February 23rd, 2010 at 9:15 am
Yeah, don’t ever use notepad or wordpad. It will surely mess up the codes – well most of the time.
Better use dreamweaver or download a free php editor like Notepad ++.
Reply
You are AWESOME! I did option 3. Worked great!
Reply
Thanks so much! The first two suggestions did not work for me, but the last one (your favorite) worked like a charm! Yay!
Reply
I don’t seem to be experiencing the same success:
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 30720 bytes) in /home/djangmoh/public_html/wp-admin/includes/plugin.php on line 428
I have gone into my wp-config.php file and putting in
<?php
define('WP_MEMORY_LIMIT', '128M');
at the top.
No luck, error prevails
Can't do solution 1 due to access issues, and solution 2 didn't do anything.
Reply
Ok, as a follow-up, I’ve asked the host to increase the memory limit, which they have to 100M. Still, the error persists below.
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 30720 bytes) in /home/djangmoh/public_html/wp-admin/includes/plugin.php on line 227
Reply