php max_input_time= -1 -1 的确切含义是什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/30357748/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 21:44:20  来源:igfitidea点击:

max_input_time= -1 What is the exact meaning of -1?

phpphp-ini

提问by Chris Muench

I couldn't find this in the docs, but does:

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

max_input_time = -1

means there is no limit?

意味着没有限制?

I find it odd that max_execution_time = 0is forever.

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

But what does -1mean for max_input_time?

但是是什么-1意思max_input_time呢?

回答by Rizier123

A quick look into the php.inifile will show you:

快速查看该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

So as you already guessed correct:

所以你已经猜对了:

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

You can see the php.inifiles for production and development on github:

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

回答by Timido

Actually the documentation says it different:

实际上文档说的是不同的:

max_input_timeinteger

This sets the maximum time in seconds a script is allowed to parse input data, like POST and GET. Timing begins at the moment PHP is invoked at the server and ends when execution begins. The default setting is -1, which means that max_execution_time is used instead.Set to 0 to allow unlimited time.

max_input_time整数

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

The doc is here: http://php.net/manual/en/info.configuration.php#ini.max-input-time

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

So, to my understanding the comment provided in php.ini is wrong.

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

回答by william.eyidi

In php.iniyou will find the answer to your question:

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

this specified that -1is unlimitedbecause no script can be executed with a negative time.

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

the value 0means you don't allow your script to parse dataor to download files.

该值0意味着您不允许脚本解析数据下载文件。

回答by taxicala

Basically max_input_time = -1means what you've said, there is no time limit for that directive.

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

回答by PhuLuong

max_input_time = -1 as maximum value. It is 2147483647 in PHP 5.4

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