Written by nitinpai on July 18th, 2007
Wordpress Error - “Allowed memory size of 8388608 bytes”
Issues, Wordpress
25 responses
You sometimes might get the following error if you are trying to import a previous blog into a newly installation of Wordpress through an RSS feed or while installing a new plugin as:
Allowed memory size of 8388608 bytes exhausted (tried to allocate xxxxx bytes)
This means that the server is not allowing to process the size of the data than its maximum alloted size. Remember that there is nothing wrong with the Wordpress installation. Its the matter of the amount of data that the server can process at one time.
Don’t be scared, you can get it resolved in a matter of seconds. There are two ways of resolving this error.
Method #1 : Without Restarting the Server
If the error mentioned appears during the importing, what you need to do is get access to the source code of the Wordpress where you have done the installation.
Once you get the access you will need to modify two files . They are:
- <installation_directory>/wp-admin/import.php
- <installation_directory>/wp-admin/import/wordpress.php
Now copy this line of code:
ini_set('memory_limit','16M');
This line increases the server processing capacity by the included size i.e 16M. Paste the above line in the import.php file just after the line of code:
require_once ('admin-header.php');
Now in the second file i.e. wordpress.php paste the code after the line of code:
<?phpNote: If the error mentioned appears during the installation of a plugin then make a note of the path and the .php page which is given out in the error and paste the same line in the mentioned .php page.Remember, the code must be pasted within the php code block i.e in between <?php and php?> in the page since it is to be executed by the server.
Now once again access your Wordpress URL and go to the manage > import menu and try importing. If your problem still remains, just keep increasing the size mentioned in the pasted code in multiples of 4 i.e. in place of “16M”, try “20M”, “24M” etc.
Method #2 : Which Requires a Server Restart
If you want to eliminate this error once and for all then you need to target your server to make the changes. But you should have the permissions to restart the server.
If you have this permission then go to the server installed path and search for the file php.ini file. In this file there will numerous things mentioned. But all you have to do is search for the term “memory_limit“. Change the value of this variable from 8M to either 16M, 24M, etc as required.
Save the file and restart your server. The error will be resolved once and for all. Good luck!
25 Responses
Thursday, July 26, 2007
thanks
Friday, July 27, 2007
After searching for answers….you explanation was PERFECT!
I got the wacky error and didn’t want to put in a trouble ticket with my hosting company.
I followed your instructions for Method #1, ftp’d those files up to my server and went back into my blog and waa-la, it worked!
Thanks so much for your excellent and easy to understand advice.
Saturday, July 28, 2007
I’m glad it was of help to you all.
Friday, August 3, 2007
[…] you like to provide your thanks, head over to the post in his blog, and express your sincere […]
Sunday, August 5, 2007
Thanks for your tips! It works wonderfully!
Sunday, August 5, 2007
Thanks Dexter!
Friday, August 24, 2007
Found the link on wordpress, maybe put the info there as well?
Great stuf!
Sunday, September 9, 2007
This post saved my day… thanks for sharing it!
Saturday, September 22, 2007
thank you very much for this description. it really helped me out!
Saturday, October 13, 2007
Thanks…
I pulled hair for hours trying to work out what i had done wrong and which plugin was at fault but ended up with the same error no matter which one was installed last.
You saved my sanity (not that theres much left to save)
So Thanks
Saturday, October 27, 2007
Hi,
I’ve recently upgraded to WordPress 2.3.1 and started getting memory exhausted errors all over place.
At this moment, I’m trying to import UTW tags, but to no avail the screen comes blank after step 1.
I searched around and found your post, and followed method#1, edited import.php and wordpress.php, but still I’m not able to complete the and getting memory error in wp-db.php. I’ve entered same values at the top of wp-db.php also, but still same error persists.
I’ve written to DreamHost also, but didn’t received reply from them as of now.
May be only you can help, waiting for your reply.
DG….
Friday, November 2, 2007
Thank you!!! You are simply the best!!!
Wednesday, December 19, 2007
Thanks alots bro. My WP Problem has fixed….
Friday, January 4, 2008
Thank you very much, now I can active all plugins without memory exhausted errors.
Wednesday, January 16, 2008
Too many thanks!
Your information has been very usefull for me !!
Monday, January 28, 2008
[…] I did find a number of support posts on the Wordpress support forums on the topic. Many had similar responses and some indicated that the responses fixed their problem. I’m not knocking Wordpress support here, but the fixes in the forums did not fix my problem. I ended up just doing a simple Google search on the issue and found this post. […]
Friday, February 15, 2008
i try your solution to the fatal error message when i’m importing my DB from my old blog…
now i recive this message:
Warning: ini_set() has been disabled for security reasons
i think is a problem with my host… is tripod.lycos.es and it’s free… i don’t want to ask for help in lycos.es, there is another solution for that ?
Friday, February 15, 2008
The only solution is to get to a good paid host. I would recommend Bluehost hosting to you since this site is being hosted by the same. The support team of Bluehost is really good and quick. The main advantage you get is to host unlimited domains on a single account!
Friday, March 7, 2008
Perfect. Appreciate your clarity.
Friday, March 14, 2008
[…] estamos envueltos, pues nos fuimos a la tarea de googlear y finalmente dimos con dos Posts [1] y [2], en los cuales vimos que la solución estaba en agregar la siguiente línea a […]
Thursday, April 17, 2008
[…] to mention this in the “minimal requirements“. After finding some info about this at techtracer and trying the “ini_set(’memory_limit’,’16M’);” hack to no avail, I […]
Sunday, May 4, 2008
[…] you like to provide your thanks, head over to the post in his blog, and express your sincere […]
Tuesday, May 27, 2008
Do you really have to do anything or will the problem just go away by itself? Wondering if it has anything to do with server load at the time…
Saturday, July 12, 2008
Hi there-
Can you please help me?
I’m scouring the internet for help.
I’ve just started to go self-hosted–> from WP.com to self hosted using WP software. I’m trying to import my blog XML file, BUT it’s too large. It’s 3+ MB and the WP software says it can only import 2MB file or smaller. What can i do? I’ve seen some posts talking about ’splitting up’ the XML file into smaller files…but i don’t understand how to do this and need step by step instructions. I’ve read your above post too but don’t know how to find the files you are talking about to make the changes. Would you be able to help me, please??
THanks!!
Lisa
http://www.llworldtour.wordpress.com
http://www.llworldtour.com
Tuesday, August 26, 2008
I think this is a very important thing. This blog post is very interesting and very well done. Thank you very much, I appreciate it!
Jim
YourVisionStatement.com