Setting Max_Input_Vars PHP.Ini Directive Using Ini_Set

setting max_input_vars PHP.ini directive using ini_set

max_input_vars has a changeable mode of PHP_INI_PERDIR meaning it can't be changed using ini_set (only in php.ini, .htaccess or httpd.conf)

PHP max_input_vars

You can add it to php.ini and it should work - just tested it on PHP 5.3.6.

max_input_vars set even if commented in php.ini

According to the manual, there is indeed a default value of 1000 for max_input_vars (look in the table at the beginning of the page).

If you want a value different than this default value of 1000, you will have to specify it -- and not comment the directive in your configuration.

As far as I can tell, there is no way to make max_input_vars unlimited ; you could set it to a high enough value, of course, but remember that this directive has been added recently as a security measure. Also, it doesn't make sense to set the max_input_vars to unlimited since then a malicious user could send a huge load of data and exhaust your memory.

Increasing max_input_var in php.ini in XAMPP

Try this in you .htaccess file:

php_value max_input_vars 2000

Or add this function in php code:

ini_set('max_input_vars', 2000);


Related Topics



Leave a reply



Submit