• I’ve seen a similar problem posted here but couldn’t find the topic again, here is the message I get when trying to access wp-admin:

    Fatal error: Allowed memory size of 262144 bytes exhausted (tried to allocate 122880 bytes) in /home/lorenrb/public_html/wp-admin/includes/dashboard.php on line 351

    I asked my friend who owns the server and he replied:
    kk, sometimes if you get that just do a hard refresh (control + f5)

    I can’t seem to do that as I use a mac.

    Any advice would be most helpful, it works when running 3.1 but would like to be able to update.

    Thanks in advance!

Viewing 4 replies - 16 through 19 (of 19 total)
  • Have you tried defining WP_MAX_MEMORY_LIMIT? It looks like the default setting for that constant is 256m, which should be enough, but maybe playing with it would give you some indication of where the problem is.

    I’ve played with it, no difference in the issue. It looks like anything that makes a memory_limit call (in wordpress) as in admin.php triggers the php error.

    Alright, here’s what I’d do if I were in your shoes (recognizing that this approach is incredibly hamfisted, and there’s a VERY good chance it will break your site while it’s in there. Use at your own risk).

    First, get yourself logged into the admin section, using whatever technique you have to (commenting out the line you specified before, from teh sounds of thigns).

    Once you’re logged in, and looking at the dashboard, uncomment the line that allowed you to log in, open wp-includes/plugin.php, and add this block at about line 171:

    if(is_admin()){
    				echo "<!--";
    				echo "FILTER $tag ".ini_get('memory_limit');
    				echo "-->\r\n";
    				}

    So the whole thing (starting at about line 166) ooks like this:

    do {
    		foreach( (array) current($wp_filter[$tag]) as $the_ )
    			if ( !is_null($the_['function']) ){
    				$args[1] = $value;
    				$value = call_user_func_array($the_['function'], array_slice($args, 1, (int) $the_['accepted_args']));
    				if(is_admin()){
    				echo "<!--";
    				echo "FILTER $tag ".ini_get('memory_limit');
    				echo "-->\r\n";
    				}
    			}
    
    	} while ( next($wp_filter[$tag]) !== false );

    Keep this open, because you’re going to want to remove it shortly. Now – refresh the dashboard, and view the source – you should have a list of filters, and what the PHP memory limit is when each of them are fired. Figure out where your memory limit goes from 32M to 256k, and you should have a starting point for your search.

    Again – this is absolutely use-at-your-own-risk. There’s a very good chance it will break something in your site, so be ready to remove it as soon as you get the info you need.

    Thanks Peter, I will try this out and report back.

Viewing 4 replies - 16 through 19 (of 19 total)
  • The topic ‘After updating wordpress I get fatal error message, can't log into wp-admin’ is closed to new replies.