PHP configuration: max_execution_time and max_input_time

后端 未结 3 1906
忘了有多久
忘了有多久 2021-01-14 12:36

Can I set the following PHP configuration parameters as follows:

max_execution_time = 360 max_input_time 360

Is that safe and efficient ?

I actually

相关标签:
3条回答
  • 2021-01-14 12:41

    By default my server has max_input_time as -1. I'm assuming that means infinite.

    0 讨论(0)
  • 2021-01-14 12:44

    In my understanding, you have to change neither.

    If you just store the video files using move_uploaded_file, you will not need to increase your max_execution_time as upload time does not count towards execution time.

    The manual says the following about max_input_time (emphasis mine):

    This sets the maximum time in seconds a script is allowed to parse input data, like POST, GET and file uploads.

    I have not tested this, but to me this sounds like it doesn't include the actual time the client spends uploading the file, just the time it takes to copy it to the temporary directory. I can't vouch for this though, and I can't find any info on it. The default of 60 seconds should be ample time to parse many hundreds of megabytes of files.

    I'd recommend to find out the perfect value using real-life tests. If your connection is too fast, use a tool to slow it down. See this SO question for suggestions:

    Network tools that simulate slow network connection

    0 讨论(0)
  • 2021-01-14 12:45

    In my case, max_input_time does affect my move_uploaded_file function. I failed to upload a 3GB file with default setting (max_input_time=60) but it succeeded with a larger value (max_input_time=300).

    My PHP version is 7.2.19 on LAMP enviroment.

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