How to Increase max_input_vars in PHP
Category: PHP
The max_input_vars setting controls the maximum number of input variables accepted by PHP scripts from HTML forms (through GET and POST requests) and cookies. By default, it is set to 1000. If your script needs to handle more variables, you will need to increase this limit.
Steps to Increase max_input_vars
To increase the number of input variables, follow these steps:
- Navigate to your PHP Configuration section in the hosting control panel.
- Click on the Edit php.ini tab and select Advanced Mode.
- Use the
CTRL + Fkeyboard shortcut to search for themax_input_varsdirective. - Locate the following line in your php.ini file:
By default, this line is commented out (disabled) with a semicolon (;).
To increase the limit, remove the semicolon and change the value to your desired limit, for example:
This change will set the max_input_vars to 5000, allowing PHP to handle up to 5000 input variables.
Why Increase max_input_vars?
The max_input_vars limit was introduced in PHP 5.3.9+ as a security feature to prevent overload attacks. However, if your web application requires handling a larger number of POST variables, you may encounter an error. Increasing this limit helps prevent such issues.


Leave your comment