• Resolved Jeffkan1

    (@jeffkan1)


    Got a strange error on my website admin console yesterday, and now I can’t log in.

    I went to the Appearance tab, Widgets page. On an existing sidebar with an existing text widget, I saw the HTML that was in there, there are two <a href> links that were <center>‘ed.

    At the bottom, outside of any HTML tags, I typed “* Guaranteed will never rust”. I clicked the Save button, and bang, I saw this error:

    “Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 491520 bytes) in /data/16/2/141/107/2956107/user/3277749/htdocs/wp-admin/menu.php on line 261”

    Now I can’t log in to the admin console. The good news is, the website is still up and alive, it is https://www.newagemh.com.

    My theme is Nevada.

    My fear is that I’ll have to rebuild my site. I’d really like to avoid that if possible.

    I researched the classic “Fatal error: Allowed memory size” problem for an hour or two, everything I tried as a fix either did not fix it or took down the website. So it feels like the error is a symptom of the real problem.

    I did wade into myphpAdmin and snoop around at the options table, looking at the fields that had the word “widget” in the name, but didn’t see an asterisk in any of the data.

    So my fix most likely is to rebuild, but I wanted to see if anyone had some suggestions on where to look and what to try. Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Fatal error: Allowed memory size of 41943040 bytes exhausted

    Your maximum memory size is set to 40M, which is a bit on the low side for a modern website.

    Contact your hosting service, and ask them what is the correct way to change your PHP memory_limit setting to something like 64M or 128M instead. The correct way to do this is host-dependent, so you’ll need to ask them for the right way.

    Thread Starter Jeffkan1

    (@jeffkan1)

    Thanks for the quick reply Samuel! Appreciate it.

    I have tried the various methods to correct the PHP memory_limit, by adding it to the wp-config.php, and by creating a php.ini file in the wp-admin folder and adding the memory limit there. No help. And the forum posts describing these fixes were from 2 yrs ago, 3 yrs ago, etc.

    Also, the actions described by people that caused this error were related to installing plug-ins, for example. My error seemed to be caused by me typing 25 characters in a widget. Could that really have caused a PHP limit problem? Just seems like the error doesn’t truly represent the problem, but maybe it does.

    Thanks again for your help. So I need to contact my hosting service Network Solutions and ask them what is the correct way to raise my PHP memory limit?

    Thread Starter Jeffkan1

    (@jeffkan1)

    Went to Network Solutions forum, found instructions for how and where to create the php.ini file. It said the root directory’s cgi-bin folder is where the php.ini file goes.

    I put in the following to the php.ini file and uploaded it to the cgi-bin folder:

    memory_limit = 64M
    output_buffering = 2048

    Started the website, comes up fine. Tried to access the wp-admin, same error as before.

    Any assistance is appreciated, thanks!

    Thread Starter Jeffkan1

    (@jeffkan1)

    I have a way to manage things… I’ve renamed the wp-content\plugins folder to “pluginsHOLD”, and I am able to log in to wp-admin page at that point.

    Will post more info later when I determine the problem.

    Thread Starter Jeffkan1

    (@jeffkan1)

    Turned out to be a plug-in that was the problem. I would rename the plugins folder back to the correct “plugins”, then would activate plug-ins one at a time until I got the “Fatal error:” message.

    I just deleted the folder for that plugin from within the plugins folder, and all is right with the world.

    Interesting facts: this problem plugin was not the last plugin that I installed, so it was working fine for several months. *shrugs shoulders*

    What you might do is create an info.php file with:

    <?php
    phpinfo();
    ?>

    Put that file in your blog’s directory then execute it. Look for:

    Loaded Configuration File to see where it is loading the PHP.INI file from. Then look for memory_limit to see what the value is.

    Also, to see how much memory is being used, can add this to theme’s functions.php file:

    function memory_stats()
    { // BEGIN function memory_stats
          echo '<p style="clear: both;">Memory used: '. number_format(memory_get_usage(true)). ' bytes.<br />';
          echo 'Peak Memory used: '. number_format(memory_get_peak_usage(true)).' bytes.</p>';
    
    } // END function memory_stats
    
    add_action('in_admin_footer', 'memory_stats');

    You can also call memory_stats() in your theme’s footer.php file to how much the front-end is using.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Typed an asterisk in a Text Widget, get "Fatal error: Allowed memory" error’ is closed to new replies.