Is there a limit like max_input_vars in versions before 5.3.9?

前端 未结 3 557
感动是毒
感动是毒 2020-12-20 20:48

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

If I run a webserver with an older PHP vers

相关标签:
3条回答
  • 2020-12-20 21:33

    I think your problem is not the number of yourform fields, I think the total data you are sending is to much.

    There is an php.ini directive that limits how much data you totally can send on a post request (check: post_max_size).

    But you can not change post_max_size while runtime (because this value is checked before the first line of you php files during input phase of php).

    Your have several ways to change this value:

    1. In Webserver Config
    2. in a htaccess file

    with the following code:

    php_value post_max_size 512M # set maximum post data to 512 MB
    
    1. in your global php.ini
    2. in your users.ini (if it's configured)

    with the following code:

    post_max_size = 512M
    
    0 讨论(0)
  • 2020-12-20 21:36

    It seems there is 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 had to guess I would say there was always a limit, and it just got pulled out into the config/documentation in 5.3.9

    0 讨论(0)
  • 2020-12-20 21:42

    There seems to be a bug in older versions:

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

    although you can alter the directive in php.ini and the change is shown correctly in phpinfo(), it has no effect.

    Behaviour: all variables exceeding 1000 are ignored

    tested in PHP 5.3.3-7+squeeze17 without suhosin module

    A possible workaround: compact all form-data with javascript

    0 讨论(0)
提交回复
热议问题