NYCPHP Meetup

[nycphp-talk] IIS 7, trigger_error, and Large File Uploads

David Krings ramons at gmx.net
Sun Jan 3 18:34:56 EST 2010


On 1/3/2010 5:41 PM, Hans Zaunere wrote:
> Oh my :)

That applies to IIS, right? I just have to ask the question: can't you just 
use a real web server that actually works, like, let's say, Apache? I 'work' 
with IIS at work and it is a totally dysfunctional kludge.


> 2.  I need to handle 200mb+ file uploads.  I'm aware of the all the caveats
> to this, and have set what I've thought to be appropriate limits in php.ini.
> I'm apparently hitting some other timeout/limit from IIS 7, though.  After
> roughly 60 seconds, I get a server 404 message.  I've done some research and
> have seen this error comes up with ASP developers, and so I don't think I'm
> hitting a PHP limit/timeout (yet).  I've looked at IIS setting
> MaxAllowedContentLength, but it's default value is apparently at 2gb.  Any
> thoughts on how a resolution, or at least how to debug what limit is getting
> hit?

Well, circumventing an issue is also a valid approach. Does the upload have to 
happen via HTTP? Maybe uploading via FTP to the same box (or one on the same 
local network) may be a workaround. The script can then later 'upload' from 
that local resource or directly access the file, which should bring the final 
upload process close to local file copy speed. Using HTTP for uploading files 
of that size is very inefficient, but may be convenient.

I did search around a bit and came across one comment in the PHP manual 
dealing with IIS having PHP installed as CGI. It is a bit older, but may still 
apply, load http://us2.php.net/features.file-upload and go to the comment from 
2003-March-09...or just keep reading here, I copied verbatim:

This took me a few days to find out: when uploading large files with a slow 
connection to my WIN2K/IIS5/PHP4 server the POST form kept timing out at 
exactly 5 minutes. All PHP.INI settings were large enough to accomodate huge 
file uploads. Searched like hell with keywords like "file upload php timeout 
script" until I realised that I installed PHP as CGI and added that as a 
keyword. This was the solution:

To set the timeout value:
1. In the Internet Information Services snap-in, select the computer icon and 
open its property sheets.
2. Under Master Properties, select WWW Service, and then click the Edit button
3. Click the Home Directory tab.
4. Click the Configuration button.
5. Click the Process Options tab, and then type the timeout period in the CGI 
Script Timeout box.


>
> Of course, if I could figure out #1, I may be better able to debug #2 :)

Can't help you with #1 other than to see what the IIS and system logs state.


Good luck!

David



More information about the talk mailing list