This is what I’ve got at the moment:
$chunksize = 1024*4;
$h = fopen($file, 'rb');
set_time_limit(600);
while(!feof($h)){
echo fread($h, $chunksize);
flush();
}
fclose($h);
I’ve tried increasing the chunk size, I’ve tried resetting the timeout with every iteration, I’ve tried setting the timeout to zero (it was originally 5min), I even tried putting the flush() outside the loop to let its own buffer take care of it, and every single time the download dies at exactly 5 minutes in. Sometimes it’s 50.2MB, sometimes it’s 54.8 or anything in between, so I know it’s not the file size. php_info() says the maximum time is 30seconds, so somehow I am able to increase it to 300 but that’s it.
Is there something in IIS (server 2003) that could be overriding it?
Ah, Microsoft MVPs. Whenever they say something’s impossible, you know it’s just a matter of digging.
http://www.murraymoffatt.com/software-problem-0002.html
I was able to give this one specific file an unlimited run time without affecting the rest of the site.
EDIT:
Looks like those articles are starting to disappear.
Resetting FastCGI Timeout in IIS 5.0 (Win2K):
Administrative Tools => Internet Services Manager).
Information Services” at the very top, then below this the name of
your computer. Right-click your computer name and select “Properties”.
“WWW Service” is showing, then click the “Edit” button.
specified in seconds. The default value is 300 seconds (5 minutes).
right back to the IIS management console. Close the management
console.
=> Accessories => Command Prompt) and type the command: iisreset
IIS 5.1 (WinXP):
Here’s the instructions for IIS 6.0: http://www.iisadmin.co.uk/?p=7
but the download link for MetaEdit is broken, so try here: http://support.microsoft.com/kb/301386