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
max_execution_time is set to 60 which is too low. A minimum execution time of 150 seconds is recommended to give the migration process the best chance of succeeding.
By default, the max_execution_time is usually set to 30 seconds. If your PHP scripts need more time, then you need to edit the value in the . htaccess file.
PHP maximum execution time limit in php.Open php. ini file using your favorite text editor. Look for max_execution_time directive. Set the value for max_execution_time in seconds.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With