0
votes

I can't save the header menu on my site in WordPress - it keeps failing with a 500 Internal Server Error. I've tried updating my .htaccess file, and the php memory limit has been set to 128M. The core files are recently updated (4.8), and everything else in the site saves fine (pages, other menus, ext.) It's just the header menu (which has 60+ items) that gets the error.

EDIT

The debug log after trying to save the menu contains no fatal errors. Lots of PHP Notices for deprecated stuff though. Here's a sample:

[16-Aug-2017 17:23:21 UTC] PHP Notice:  Undefined variable: th_query in /var/www/vhosts/mysite.com/mysubsite.com/wp-content/themes/mysitetheme/functions.php on line 377
[16-Aug-2017 17:23:21 UTC] PHP Notice:  Trying to get property of non-object in /var/www/vhosts/mysite.com/mysubsite.com/wp-content/themes/mysitetheme/functions.php on line 377
[16-Aug-2017 17:23:23 UTC] PHP Notice:  The called constructor method for WP_Widget in WDG_SpecialRecentPostsPro is <strong>deprecated</strong> since version 4.3.0! Use <pre>__construct()</pre> instead. in /var/www/vhosts/mysite.com/mysubsite.com/wp-includes/functions.php on line 3894
[16-Aug-2017 17:30:27 UTC] PHP Notice:  Use of undefined constant url - assumed 'url' in /var/www/vhosts/mysite.com/mysubsite.com/wp-content/themes/mysitetheme/header.php on line 339

The 500 error still only shows up when trying to save the header menu in Appearance > Menus.

1
check server logs please - Moiz Shafqat Husain
Does the same happen if you paste the code in header.php? Also, is your syntax valid? - I haz kode
500 usually means the syntax error. Check the source code in a browser to see where the generated HTML stops. - user8230352
@MoizShafqatHusain I'll check the debug logs. - user2268170
@user8230352 This is the WordPress nav-menus.php (Appearance > Menus in wp-admin) page, and trying to save it results in the 500 error. I'm not sure which source code I'm supposed to check for failure. Both appear fine to me in that the HTML is complete. - user2268170

1 Answers

0
votes

I found this article with similar issue:

WordPress is not limiting the number of menus you can have. Your web hosting server is.There are limitations on the POST max variables which is limiting the large number of entries being saved.

So try to increase the following PHP settings in php.ini to something like shown below:

post.max_vars = 5000
request.max_vars = 5000