Support » Fixing WordPress » Fatal Error

  • I get this error when I try to add items to the menu.

    Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 122880 bytes) in /data/23/3/86/120/3086772/user/3439605/htdocs/wp-admin/includes/nav-menu.php on line 157

    I’m not really sure how to fix it.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Kindly reduce your menu items / increase your memory_size.

    Any recommendations to what I should increase it to?

    To increase PHP memory limit add such line in your PHP.ini file


    Moderator Mark Ratledge


    Forum Moderator

    Using FTP you can try increasing the memory for PHP and WordPress in several different ways:

    1) You can edit the memory_limit line in your php.ini (if you have access to that file) to increase memory to 64M:

    memory_limit = 64M;

    2) Try adding the “define” line below in your wp-config.php file a few lines of white space below the opening <?php in the file:

    define('WP_MEMORY_LIMIT', '64M');

    3) If those don’t work, try adding this line at the top of your .htaccess file:

    php_value memory_limit 64M

    If that doesn’t work or throws a “500 Internal Server Error”, delete the line from .htaccess.

    If none of those work, your host probably doesn’t allow memory allocation overrides. You’re stuck with what they give.

    You can run phpinfo to see what kind of memory allocation you already have. Make a plain text file and call it phpinfo.php and put just this line in it:

    <?php phpinfo(); ?>

    then put the file in the root of your server, and then go to that file with your web browser. You’l see all the php info you need; scroll down for memory settings. If you get an error, that means your web hosting company won’t allow phpinfo to run for security reasons.

    I guess that’s my problem. No php.ini file.



    very awesome

    You should set the memory limit to at least 64M. You could go more, but most times that shouldn’t be required.

    I’d also suggest looking at the menu structure of your site. How many items do you have in the menu to get up over 40MB of memory used for a menu?

    I set the size to 64mb. I only have 6 menu items – no drop downs. Seems odd to me that I ran out of memory.

    Moderator Mark Ratledge


    Forum Moderator

    Use the define('WP_MEMORY_LIMIT', '64M'); line I posted above.

    Who is the webhost?

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Fatal Error’ is closed to new replies.