• Hi there, my hosting company recently upgraded the PHP version on their servers to 5.4. This has not affected anything on my WordPress sites apart from the ability to save more than 100 items in the menu.

    Previously I added this Sohusin Post Variable code to my .htaccess to enable me to save more items:

    php_value suhosin.post.max_vars 5000
    php_value suhosin.request.max_vars 5000

    Now PHP 5.4 does not use Sohusin (not compatible), so I have removed this code from my .htaccess. I have been informed by the hosting company that there are no limits applied server-side for post or request vars, so surely I should be able to save as many menu items as I like. I now receive a connection timeout error every time I try and save more menu items. Could anyone point me in the direction of the possible cause and solution?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter G-Olly

    (@g-olly)

    I have found this article which seems to explain the problem and possible solutions – sevenspark.com

    The increasingly common issue is the max_input_vars PHP directive. By default, it is set to 1000. To increase this, simply set it in php.ini. I’d suggest 3000 to be safe, but 2000 should be sufficient for most sites.

    1. max_input_vars = 3000

    How do you edit php.ini? That depends on your host. If you have access to the php.ini file, simply add or edit the directive, save, and restart Apache. If you’re with a web host that doesn’t give you access (common with shared hosting), you may have to contact your host and have them make the change for you.

    Thread Starter G-Olly

    (@g-olly)

    Seems it can be added via .htaccess as well:

    php_value max_input_vars 3000

    Thread Starter G-Olly

    (@g-olly)

    Sohusion directives in case:

    php_value suhosin.get.max_vars 3000
    php_value suhosin.post.max_vars 3000
    php_value suhosin.request.max_vars 3000

    Thread Starter G-Olly

    (@g-olly)

    Worked brilliantly for me. I hope that this helps anybody experiencing the same problem. Resolved.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Can't save menu items after PHP upgrade to 5.4’ is closed to new replies.