+1-855-211-0932 (ID:287497)
Don't have an account yet? Sign up now!

HomeArticlesHow to Increase max_input_vars in PHP

How to Increase max_input_vars in PHP

How to Increase max_input_vars

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:

  1. Navigate to your PHP Configuration section in the hosting control panel.
  2. Click on the Edit php.ini tab and select Advanced Mode.
  3. Use the CTRL + F keyboard shortcut to search for the max_input_vars directive.
  4. Locate the following line in your php.ini file:
; max_input_vars = 1000

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:

max_input_vars = 5000

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.



Tags: , , , , , , , , , , , , ,

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>