【发布时间】:2015-08-02 04:15:23
【问题描述】:
我在文档中找不到这个,但是:
max_input_time = -1
表示没有限制?
我觉得奇怪的是max_execution_time = 0 是永远的。
但是-1 对max_input_time 意味着什么?
【问题讨论】:
我在文档中找不到这个,但是:
max_input_time = -1
表示没有限制?
我觉得奇怪的是max_execution_time = 0 是永远的。
但是-1 对max_input_time 意味着什么?
【问题讨论】:
实际上文档说的不同:
最大输入时间整数
这设置允许脚本解析输入数据(如 POST 和 GET)的最长时间(以秒为单位)。计时从服务器调用 PHP 的那一刻开始,到执行开始时结束。 默认设置为 -1,表示使用 max_execution_time。 设置为 0 允许无限时间。
文档在这里: http://php.net/manual/en/info.configuration.php#ini.max-input-time
所以,据我了解,php.ini 中提供的注释是错误的。
【讨论】:
快速查看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 文件:
【讨论】:
在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 表示您不允许您的脚本解析数据或下载文件。
【讨论】:
max_input_time = -1 作为最大值。在 PHP 5.4 中为 2147483647
【讨论】:
基本上max_input_time = -1就是你所说的,那个指令没有时间限制。
【讨论】: