Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

setting max_input_vars PHP.ini directive using ini_set

Tags:

php

php-ini

Can I set the max_input_vars PHP.ini directive in my code? I have it set at the default 1000, however I have a script that has many checkboxes and text fields that could, and quite possibly will, go over the 1000 limit.

I'm using PHP 5.3.10 and i'm not getting any errors doing this. Also, I can't find any documentation that states I can't do this.

ini_set('max_input_vars', 3000); 

Thanks.

like image 622
crmpicco Avatar asked Apr 02 '12 09:04

crmpicco


People also ask

How do you fix PHP setting max_input_vars must be at least 5000?

If you created your own PHP. ini file, then add the same code inside it: max_input_vars = 5000 Simply change the value to the recommended value. For example, 5000. Save your changes, and reboot your localhost or your server.

What is max_input_vars in PHP INI?

max_input_vars is a setting managed through the PHP setting file (php. ini) which limits the number of inputs you can set when posting forms. The Jomres Micromanage and Standard tariff editing modes allow you to have precise control over the price of each and every day in your property, for each room type.

Where do I change PHP max input variables?

By default, the maximum number of input variables allowed for PHP scripts is set to 1000. You can change this amount by setting the max_input_vars directive in a php. ini file. To verify the current value of the max_input_vars directive and other directives, you can use the phpinfo() function.


1 Answers

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)

like image 73
pjumble Avatar answered Sep 20 '22 00:09

pjumble