PHP 5.3 max_input_vars and big forms

Starting from PHP 5.3.9 there is a brand new php.ini option: max_input_vars. You may read in the PHP documentation about it. But what you don’t probably now is that if you are using the Suhoshin patch (for example if you’re using dotdeb packages), then you need to tweak 2 other variables to increase the max number of POST variables accepted by your PHP.

So, if you want to increase this number to, say, 3000 from the default number which is 1000, you have to put in your php.ini these lines:


max_input_vars = 3000
suhosin.post.max_vars = 3000
suhosin.request.max_vars = 3000

The other suitable option is to fix your form and make it saner :)

11 thoughts on “PHP 5.3 max_input_vars and big forms

  1. I had a similar problem working in localhost with WAMP server, changing the file
    C: \ wamp \ bin \ php \ php5.3.9 \ php.ini the value max_input_vars remained the same as 1000.
    After 2 hours of testing I found that I had to change the file
    C: \ wamp \ bin \ apache \ Apache2.2.21 \ bin \ php.ini and it worked!

  2. You’ll get this error when installing PHP/prestashop and working on translations. Each translatable label has its own text input in one insanely big form…

  3. I also solved my problem with Prestashop translations on my MAMP. It worked only with the first line, I guess I don’t have that Suhoshin Pach on it.

  4. I done the same thing.. Its not working if a form has more than 1000 inputs. My form has 2500 checkboxes. while submitting its shows only 1000. and in my php,ini the value as follows

    max_input_nesting_level => 64
    max_input_time=> 60
    max_input_vars =>3000

Leave a comment