Tell me more ×
WordPress Answers is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have tried all the following (although many said I only need either one)

  1. memory_limit = 512M (it's stated in my phpinfo(), this limit was set so long ago that I can't even remember when)
  2. php_value memory_limit512M in .htaccess
  3. define('WP_MEMORY_LIMIT', '512M');in wp-config.php

I'm still getting the same fatal error:

Interestingly, I can see

Choose a file from your computer: (Maximum size: 0)

when I went to Tools > Import > WordPress in my WordPress dashboad. According to the following, that "Maximum size" should agree with the above settings instead. http://codex.wordpress.org/FAQ_Working_with_WordPress#How_do_I_Import_a_WordPress_WXR_file_when_it_says_it_is_too_large_to_import.3F (screenshot: http://sg.theasianparent.com/images/errors/import_wordpress.PNG)

The exact error message (with exact memory figures) is as follows:

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 121026561 bytes) in /home/asianp/public_html/sg/wp-includes/functions.php on line 3155

Would really appreciate if someone can shed some light here :)

Thank you very much!

Reference: http://stackoverflow.com/questions/3463276/allowed-memory-size-of

share|improve this question
1  
Gosh, it sure seems like there's some interference if your import is using that much memory (though 7M is a big import). My hunch, with nothing to support it, is that you're circling an infinite loop. Where did the import file come from? If WordPress, is it the same version? Are you using WP 3.3.1 and the latest import plugin? Do you have any other plugins activated (if so, try deactivating everything except the importer)? Do you have anything fancy in your theme or are you just using something basic? – Matthew Boynes Jan 28 '12 at 21:26
agree w/ matthew's comment. you might be caught in a loop... has happened to me. – helgatheviking Feb 28 '12 at 4:17

closed as too localized by toscho Apr 9 '12 at 5:06

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.

2 Answers

There are two parameters defining the maximum upload file size: post_max_size and upload_max_filesize. Try increasing both to eliminate the Maximum size 0.

As for the memory limit, did you reloaded/restarted the PHP server? (apache2 is you use mod_php and FCGI/FPM if other)

share|improve this answer
I don't belive these values are relevant here as they have to do with the size of the file I'm trying to upload which is only 7MB+. (For your reference, both my post_max_size and upload_max_filesize are set to 200M). Someone else agreed with me on this link – Eric Nguyen Nov 9 '11 at 9:52
and to the best of my knowledge, restarting Apache services is not necessary for updates in php.ini to take effect. In addition, the fact that the updated [memory_limit]code value shows up in phpinfo() means that updated php.ini is in action, isn't it? – Eric Nguyen Nov 9 '11 at 10:03
please correct me if I'm wrong anywhere, thanks – Eric Nguyen Nov 9 '11 at 10:03
you do need to restart apache, mod_php does not scan php.ini all the time, it would be a brutal overhead. – petermolnar Nov 9 '11 at 11:42

You could try increasing the max_execution_time in case the upload's timing out. Add these lines to your .htaccess:

php_value max_execution_time 3000
php_value max_input_time 3000

It's possible that your host won't allow these values to be overridden, so the best advice might be to contact them and ask why you're getting the out of memory error.

From the WordPress Importer plugin FAQ (emphasis mine):

Help! I'm getting out of memory errors or a blank screen.

If your exported file is very large, the import script may run into your host's configured memory limit for PHP.

A message like "Fatal error: Allowed memory size of 8388608 bytes exhausted" indicates that the script can't successfully import your XML file under the current PHP memory limit. If you have access to the php.ini file, you can manually increase the limit; if you do not (your WordPress installation is hosted on a shared server, for instance), you might have to break your exported XML file into several smaller pieces and run the import script one at a time.

For those with shared hosting, the best alternative may be to consult hosting support to determine the safest approach for running the import. A host may be willing to temporarily lift the memory limit and/or run the process directly from their end.

share|improve this answer
Thanks @Nick for that. – Eric Nguyen Nov 9 '11 at 14:41
I had time out error before but the error went away after I asked my host to raise both max_execution_time an max_input_time to 300. I am using a dedicated server, not shared hosting. – Eric Nguyen Nov 9 '11 at 14:59

Not the answer you're looking for? Browse other questions tagged or ask your own question.