Extending PHP Transaction Timeout for Large Video Uploads
When attempting to upload large videos, you may encounter errors indicating that the transaction exceeded the default timeout of 60 seconds. To resolve this issue and facilitate successful video uploads, it is essential to modify certain PHP configurations within your php.ini file.
max_execution_time
PHP's max_execution_time directive limits the maximum time a script is allowed to run. The default value is 60 seconds, which may be insufficient for uploading sizable videos. To extend this timeout, you can set the following parameter:
max_execution_time = 600000
This value corresponds to 10 minutes, providing ample time for the upload process to complete.
upload_max_filesize
Another crucial setting is upload_max_filesize, which determines the maximum size of files that can be uploaded. For large videos, this limit may need to be increased:
upload_max_filesize = 500M
This value permits uploads of files up to 500 megabytes.
Locating php.ini
The location of your php.ini file varies depending on your system environment. You can typically find it in one of the following directories:
Consult the PHP documentation for more specific information: https://www.php.net/manual/en/ini.list.php
The above is the detailed content of How Can I Increase PHP's Transaction Timeout for Large Video Uploads?. For more information, please follow other related articles on the PHP Chinese website!