• Resolved WPJ

    (@wpj)


    Hello. I’m still a novice when it comes to wordpress. When I go to my wordpress blog located at https://www.wwedivaspictures.com/feed/ I get the following error ‘Fatal error: Allowed memory size of 94371840 bytes exhausted (tried to allocate 262144 bytes) in /home/wwedivas/wwedivaspictures.com/feed/wp-includes/cron.php on line 269’

    I don’t have the first clue on how to go about fixing this. I searched around the forum to try to find something that would help, but couldn’t find anything that stood out to me. Any help would be appreciated.

Viewing 15 replies - 1 through 15 (of 17 total)
  • Moderator t-p

    (@t-p)

    try increasing memory available for php.

    Thread Starter WPJ

    (@wpj)

    How would I go about doing that?

    Borge

    (@joeborge0914)

    Go to this path

    home/username/public_html/wp-includes/default-constants.php

    modify the codes in it into

    // set memory limits
    if ( !defined(‘WP_MEMORY_LIMIT’) ) {
    if ( is_multisite() ) {
    define(‘WP_MEMORY_LIMIT’, ‘256M’);
    } else {
    define(‘WP_MEMORY_LIMIT’, ‘256M’);
    }
    }

    if ( ! defined( ‘WP_MAX_MEMORY_LIMIT’ ) ) {
    define( ‘WP_MAX_MEMORY_LIMIT’, ‘512M’ );

    WordPress created default from 40 40 60 M. That is why this is getting the error. Additionally you should check the server side by adding PHP.ini file with the values below.

    memory_limit = 512M

    Hope this helps.

    Thread Starter WPJ

    (@wpj)

    You Rock! The blog is back up and running again ?? Though I would like to know the exact coding I would need in the PHP.ini file cause I don’t know anything about setting up PHP coding unfortunately.

    Borge

    (@joeborge0914)

    Here are the following values you should add in the PHP.ini.

    Some of there arent needed as it is added in default in server. However, some of the cases where in a faulty cageFS stops mysqli extensions from running thus it is better to add it in as well. But if your host is reliable, then no need for you to add ” mysqli extensions”.

    memory_limit = 512M
    upload_max_filesize = 512M
    post_max_size = 512M
    safe_mode = Off
    max_file_upload = 512M
    max_post_size = 512M
    max_execution_time = 300

    suhosin.simulation = On
    suhosin.post.max_vars = 4096
    suhosin.request.max_vars = 4096
    request.max_varname_length = 350
    suhosin.session.encrypt = off
    magic_quotes_gpc = Off
    magic_quotes_runtime = Off
    magic_quotes_sybase = Off

    extension=pdo.so
    extension=pdo_sqlite.so
    extension=sqlite.so
    extension=pdo_mysql.so
    extension=gd2.so
    extension=curl.so
    extension=mbstring.so
    extension=mcrypt.so
    extension=mysqli.so
    extension=mysql.so
    extension=pdo_mysql.so

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    Wrong wrong wrong. NEVER MODIFY CORE. The appropriate method is to allocate more memory via .htaccess or php.ini or in wp-config.php

    https://docs.woothemes.com/document/increasing-the-wordpress-memory-limit/

    Borge

    (@joeborge0914)

    It is actually fine.

    @sterndata if plug ins on your site/blog needs more than 256M and the default is 256, then how can you have it adjusted then?. You may check this ticket below raised to WP core.

    https://core.trac.www.ads-software.com/ticket/13847
    https://core.trac.www.ads-software.com/attachment/ticket/13847/13847.2.patch

    Hope it helps you understanding WP core.

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    There is a constant that can be set in wp-config.php, per
    https://codex.www.ads-software.com/Editing_wp-config.php

    Editing Core files is bad — and any changes you make will be blown away with the next update. Please do not suggest to people that they edit core.

    Moderator Marius L. J.

    (@clorith)

    It actually isn’t fine, any changes made to core files will be overwritten with the next WordPress update, increasing the value via any of the means @sterndata mentioned is the right way to approach this.

    I would add that if your site requires >256 Mb ram, your host will most likely end up shutting down your site if it’s a shared host for abusing the resources, and I’d highly recommend looking into what is using so much memory instead of trying to duct-tape it together and hope for the best (I’m sure one of the fine ladies or gentlemen will be happy to assist you in how to look into that ?? )

    Thread Starter WPJ

    (@wpj)

    Wow I am super confused and lost now.

    Moderator Marius L. J.

    (@clorith)

    @wpj
    Terribly sorry about the confusion, I stepped in to clear up some misinformation and misconceptions going on to avoid anyone from making any mistakes that might come back and bite them later on ??

    Basically, any file in the wp-admin or wp-includes directories should never be edited directly (unless you know what you are doing in there and are aware of the limitations and drawbacks this imposes).

    If your site requires this much memory, it would be advisable to contact your host about possibly getting an upgrade, or looking into what is using so much memory (if your site is business critical, and you are unfamiliar with how to diagnose it or just don’t want to dive into it, I would suggest looking to hire someone to look into it for you).

    If you are familiar with it and feel like getting your hands dirty, these two plugins are great approaches to getting started:
    https://www.ads-software.com/plugins/p3-profiler/
    https://www.ads-software.com/plugins/query-monitor/

    The P3 Profiler being the simplest one to get started with, as the Query Monitor one requires you to make configuration changes.

    Thread Starter WPJ

    (@wpj)

    I’m even more confused now. I tried editing the wp-config.php file with the instructions at https://docs.woothemes.com/document/increasing-the-wordpress-memory-limit/ where it says to edit your wp-config.php file and enter something like:

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

    I entered that but I don’t know where in the code it’s supposed to be added, and it didn’t do anything so maybe I didn’t enter it where it should be added in the code? I tried the .htaccess suggestion though it was the first time I ever did anything involved with .htaccess. So I don’t know where php_value memory_limit 64M is supposed to be entered in it. Like I said, I’m a complete novice with this. The only thing that has worked is what Borge had me do. I have a facebook for this site where my RSS feed automatically posts to my site’s Twitter and facebook, and I have pretty active followers. So any new or existing people clicking on links to blog posts are gonna see that error. So I need it to always be up and running. I know my host would contact me if I am using too much memory, and not just blindside me because my coppermine gallery used to be super popular and was using up way too much bandwidth. They contacted me about it and I had to upgrade the server. I can’t afford to do any upgrading with anything with this site nowadays.

    Why couldn’t I just re-upload the default-constants file whenever there are updates?

    Borge

    (@joeborge0914)

    In my hosting company we allow max 512M RAM. Thats why I suggested it. I also monitored customers calling me bout this issue. Right after editing the file, they never get issue at all.

    However, changing this file allows u to use lots of plug ins though but the disadvantage is if you will use lots of them it may affect server child processes and might disable the CageFs mounted in the server.

    So just be careful using lots of plug ins.

    but as they said, its not recommended.. so i will not recommend it to you as well no more. You may talk to ur host bout it.

    additionally you may add this in the wp-config.php as an option
    //increase WP Memory Limit
    define(‘WP_MAX_MEMORY_LIMIT’, ‘256M’);

    Thanks, this is helpful.

    Thanks, this is helpful.

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘How do I fix 'Fatal error: Allowed memory size of 94371840 bytes exhausted' ?’ is closed to new replies.