【问题标题】:max_input_time= -1 What is the exact meaning of -1?max_input_time= -1 -1的确切含义是什么?
【发布时间】:2015-08-02 04:15:23
【问题描述】:

我在文档中找不到这个,但是:

max_input_time = -1

表示没有限制?

我觉得奇怪的是max_execution_time = 0 是永远的。

但是-1max_input_time 意味着什么?

【问题讨论】:

    标签: php php-ini


    【解决方案1】:

    实际上文档说的不同:

    最大输入时间整数

    这设置允许脚本解析输入数据(如 POST 和 GET)的最长时间(以秒为单位)。计时从服务器调用 PHP 的那一刻开始,到执行开始时结束。 默认设置为 -1,表示使用 max_execution_time。 设置为 0 允许无限时间。

    文档在这里: http://php.net/manual/en/info.configuration.php#ini.max-input-time

    所以,据我了解,php.ini 中提供的注释是错误的。

    【讨论】:

      【解决方案2】:

      快速查看php.ini 文件将显示:

      ; Maximum amount of time each script may spend parsing request data. It's a good
      ; idea to limit this time on productions servers in order to eliminate unexpectedly
      ; long running scripts.
      ; Note: This directive is hardcoded to -1 for the CLI SAPI
      ; Default Value: -1 (Unlimited)
      ; Development Value: 60 (60 seconds)
      ; Production Value: 60 (60 seconds)
      ; http://php.net/max-input-time
      max_input_time=60
      

      所以你已经猜对了:

      ; Default Value: -1 (Unlimited)
                     //^^^^^^^^^^^^^^
      

      您可以在github 上查看用于生产和开发的php.ini 文件:

      【讨论】:

      • “-1”对所有版本的 PHP 都有效吗?
      • @luisdev 不太清楚,但我很确定它适用于每个 PHP 版本。
      【解决方案3】:

      php.ini 你会找到问题的答案:

      ; Maximum amount of time each script may spend parsing request data. It's a good
      ; idea to limit this time on productions servers in order to eliminate unexpectedly
      ; long running scripts.
      ; Note: This directive is hardcoded to -1 for the CLI SAPI
      ; Default Value: -1 (Unlimited)
      ; Development Value: 60 (60 seconds)
      ; Production Value: 60 (60 seconds)
      ; http://php.net/max-input-time
      max_input_time=60
      

      这指定-1无限,因为没有任何脚本可以在负时间执行。

      0 表示您不允许您的脚本解析数据下载文件。

      【讨论】:

        【解决方案4】:

        max_input_time = -1 作为最大值。在 PHP 5.4 中为 2147483647

        【讨论】:

          【解决方案5】:

          基本上max_input_time = -1就是你所说的,那个指令没有时间限制。

          【讨论】:

            猜你喜欢
            • 2019-03-24
            • 2011-12-14
            • 1970-01-01
            • 2011-05-06
            • 2013-07-22
            • 1970-01-01
            • 2017-04-19
            • 2021-08-10
            相关资源
            最近更新 更多