简体   繁体   中英

PHP max execution time

Is it going to be a strain on my server if I am using PHP scripts to download a file while the file is very large, and it takes around 4 minutes to download it via PHP. Currently I'm executing the script in the browser, but when I switch to my linux server it will be executed via the shell. Right now I have put this in my script:

ini_set('max_execution_time', 5000); 

Are there any negative factors to using ini_set I should be aware of when it takes quite a bit of time for a PHP script to execute because it is download a large .ZIP file? Should I have to worry about memory leaks?

Instead of just sending the file in one large chunk, why not split it up into lots of little chunks. The benefit of that is it stops php from timing out & lets you download larger files.

Take a look at this tutorial for more info http://teddy.fr/blog/how-serve-big-files-through-php

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM