Need help? Call us on 1300 789 260

max_input_vars error

Difficulty: Intermediate

Overview

The PHP variable "max_input_vars" was introduced in PHP 5.3.9+ as a security measure to limit the maximum amount of POST variables submitted, by default this limit is set to 1000.

In the Apache error log you will see an error like this:

"PHP Warning: Unknown: Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini."

To resolve, the default value can be increased as per below.

Note: This was completely fixed in WordPress 4.5 and above. If you're not running the latest version of WordPress, we highly recommend upgrading instead of making the changes below.

Shared Hosting

  1. Create or update your .htaccess file and add the following line:
    php_value max_input_vars 3000
    
    

    Note: Your hosting provider may not allow this to be overridden, if this doesn't work then please check with your provider.

VPS Hosting

There are two ways to achieve this, depending on how many sites you wish to enable it for. The first method is per-site, which means that the setting remains if you migrate the site to a new server. The second is per server, meaning the setting will be applied for all sites.

  1. In Plesk under the tab "Website & Domains" > PHP Settings > add the below to the field "Additional Configuration Directives":
    max_input_vars = 3000
    Note: The field "Additional configuration directives" in Plesk is only available to the Plesk Panel Administrator.
  2. or; SSH to VPS and add the below to /etc/php.ini:
    max_input_vars 3000
    
  3. Restart Apache to apply.
Was this article helpful? Yes No
👥

Having trouble? We’re here to help!

We’ve built our company with a serious focus on quality service. Feel free to give us a call!

1300 789 260