Skip to content

PHP 5.3 max_input_vars and big forms

by on February 16, 2012

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 :)

About these ads

From → Fixes, Linux, PHP

10 Comments
  1. ozzo permalink

    thanks a lot!!!!!

  2. Thanks for identifying an issue with a large administrator form not saving all the data.

  3. 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!

  4. 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…

  5. 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.

  6. I need it. thank for sharing.

  7. Annamalai permalink

    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

Trackbacks & Pingbacks

  1. Does your large WordPress menu get truncated? | BryteSun Development

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: