Is there a limit like max_input_vars in versions prior to 5.3.9?

It seems that there is a problem with older versions of PHP and more than 1000 input fields in one form ( see this question ).

If I run a web server with an old version of PHP, is there a limit for the maximum number of form elements in (one nesting level), for example, is it controlled by the php.ini max_input_vars directive with PHP 5.3.9?

Or is there no limit in older versions?

What happens if I set this variable in older versions in php.ini or .htaccess?

I noticed that on my server I am running PHP 5.3.3-7 + squeeze17, which also already has a max_input_vars directive.

How exactly do older versions behave?

+5
php configuration
Sep 27 '13 at 4:28
source share
3 answers

There seems to be an error in older versions:

https://bugs.php.net/bug.php?id=65778

although you can change the directive in php.ini and the change displays correctly in phpinfo() , it does not work.

Behavior: all variables greater than 1000 are ignored

tested in PHP 5.3.3-7 + squeeze17 without suhosin module

Possible workaround: compressing all form data using javascript

+1
Sep 28 '13 at 5:54 on
source share
— -

There seems to be confusion:

http://www.flowstopper.org/2012/12/my-php-wtf-of-day-maxinputvars.html

Although the docs say, "Available since PHP 5.3.9."

http://php.net/manual/en/info.configuration.php

If I were to guess, I would say that there was always a limit, and they just pulled it into the configuration / documentation in 5.3.9

+3
Sep 27 '13 at 4:54 on
source share

I think that your problem is not in the number of form fields, I think that the full data that you submit is a lot.

There is a php.ini directive that limits the amount of data that you can completely send on request (check: post_max_size ).

But you cannot change post_max_size at run time (since this value is checked before the first line of your php files during the php input phase).

You have several ways to change this value:

  • In web server configuration
  • in htaccess file

with the following code:

 php_value post_max_size 512M # set maximum post data to 512 MB 
  • in global php.ini
  • in users.ini (if configured)

with the following code:

 post_max_size = 512M 
-one
Sep 27 '13 at 6:15
source share



All Articles