Home > Backend Development > PHP Tutorial > How Can I Increase PHP's Transaction Timeout for Large Video Uploads?

How Can I Increase PHP's Transaction Timeout for Large Video Uploads?

Barbara Streisand
Release: 2024-11-30 19:10:14
Original
482 people have browsed it

How Can I Increase PHP's Transaction Timeout for Large Video Uploads?

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
Copy after login

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
Copy after login

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:

  • Windows: C:phpphp.ini
  • Linux: /etc/php.ini
  • OS X: /etc/php.ini

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!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template