• Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 40 bytes) in /home/gcsunade/webapps/main_wordpress/wp-includes/wp-db.php on line 2223

    I keep getting the above message when trying to fix my wordpress. I changed my theme, and immediately got this message, and now I can’t access my WordPress account to change it back. I’ve been trying to find a solution for the past 6 hours, and everyone just says to increase the memory and gives great instructions as to how to do it- except I can’t access the coding because of the error message. It’s maddening.

    If I could just change my theme or something, that would solve my problem.

    Someone please help me.

Viewing 8 replies - 1 through 8 (of 8 total)
  • You shouldn’t need access to WordPress to address the memory limit. You should login via FTP, edit your wp-config.php file and place this line in it:

    define(‘WP_MEMORY_LIMIT’, ’64M’);

    If you are unsure how to login to FTP, you should contact your web hosting provider for assistance.

    Sorry, I should note that you may need to increase where I wrote 64M to something like 128M or even 256M. Start small and then work your way up if you continue to receive the error.

    Moderator James Huff

    (@macmanx)

    The wp-config.php define actually hasn’t worked for a few versions. WordPress now automatically scales up to the maximum memory PHP is allocated as needed.

    If you’re seeing this error either suddenly (no specific task was done to cause the error) or frequently, try deactivating all plugins to rule-out a plugin-specific issue and try switching themes to rule-out a theme-specific issue.

    Otherwise, here are three ways to increase PHP’s memory allocation:

    1. If you can edit or override the system php.ini file, increase the memory limit. For example, memory_limit = 128M

    2. If you cannot edit or override the system php.ini file, add php_value memory_limit 128M to your .htaccess file.

    3. If neither of these work, it’s time to ask your hosting provider to temporarily increase PHP’s memory allocation on your account. Keep in mind that most decent hosting providers allocate 32 MB to PHP under each account, and most decent hosting providers allow users to temporarily increase the memory allocation. If your hosting provider won’t accommodate you, perhaps it’s time to find a new hosting provider.

    (in the above examples, the limit is set to 128MB)

    James,
    Are you sure? I defined the memory limit within wp-config.php in a site this week (running the latest version of WordPress) and it resolved the issue perfectly.

    I realize there are lots of other ways to do this as well but I can assure you that it worked on the newest version of WordPress.

    Moderator James Huff

    (@macmanx)

    Hm, good question. It’s been too long for me to remember exact specifics, and the line still *functions*, it’s just that it’s not necessary. WordPress *should* burst the memory allocated to PHP if needed, so these days if you’re hitting a limit, increasing PHP’s memory overall is a good solution.

    It’s also worth pointing out that the process hitting the max could have been *either* WordPress or PHP itself, so boosting PHP overall and allowing WordPress to burst if needed should fix the problem.

    Thread Starter realnicklandon

    (@realnicklandon)

    Thanks everyone. I’m having no luck logging in via FTP, my connection keeps timing out or the webpage is not available. I’ll talk with our hosing service in the morning and see where it goes. I’m new to WordPress, and this is literally the FIRST TIME someone mentioned anything about logging in via FTP before going into codespeak. So, thank you for that.

    Best of luck! Yes you will want to familiarize yourself with logging into your server via FTP, hopefully your host can provide some assistance. If you’re not comfortable with it, you may want to seek outside assistance.

    Moderator James Huff

    (@macmanx)

    Definitely talk to your hosting provider. If FTP keeps timing out, something is definitely not right with your server, or another site on the same server is hogging all of the resources, hence the timeouts and memory errors.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘allowed Memory exhausted- can't log in to fix it’ is closed to new replies.