开发者

PHP configuration: max_execution_time and max_input_time

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 need my user to upload large videos with the php-based Content Management System开发者_开发百科.

So, each video upload takes some minutes. Do I need to change both and the values are good ?

thanks


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


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜