Hello!
Quick question, i got a file uploader that can do huge files, so if i want someone to upload 1GB, what do i set the max_execution_time in php.ini to?

Dani AI

Generated

max_execution_time is not the primary setting for a large HTTP upload. PHP uses upload_max_filesize and post_max_size to limit size, and max_input_time controls how long PHP will spend parsing incoming POST data (the actual upload). max_execution_time governs script runtime after input parsing. See the official docs for those directives: upload_max_filesize, post_max_size, max_input_time and max_execution_time.

For a 1GB single-file HTTP upload, set upload_max_filesize and post_max_size above 1G, put upload_tmp_dir on a disk with enough free space, and increase max_input_time to accommodate the expected upload duration (or -1 to disable). max_execution_time can stay modest for short post-upload processing, or be increased/disabled if heavy processing occurs. Example php.ini-style settings (example only; tune for environment):

upload_max_filesize = 2G
post_max_size = 2G
max_input_time = -1
max_execution_time = 300
upload_tmp_dir = /path/to/tmp
memory_limit = 512M

Chunked, resumable, or direct-to-storage uploads avoid long single connections and are strongly recommended (as suggested). Modern options include the tus protocol or client libraries like Resumable.js, and direct multipart uploads to object storage (which bypass PHP for the transfer). Also verify web-server and proxy timeouts and body-size limits (nginx client_max_body_size / client_body_timeout, Apache Timeout) so the whole stack supports large transfers (nginx docs). As noted, existing upload projects help—but prefer actively maintained libraries that support chunking and resume.

Recommended Answers

All 2 Replies

chunk your files, and use ajax.

Member Avatar for Member #120589

You want to upload a 1Gb file?? Check out sourceforge for an uploader.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.