Previous Next

Thread: PHP file upload on IIS 6

Last post 01-23-2008 4:15 AM by axelay. 7 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (8 items)

Sort Posts:

  • 12-20-2007, 6:08 AM

    • axelay
    • Not Ranked
    • Joined on 12-20-2007, 5:53 AM
    • Posts 5
    • axelay

    PHP file upload on IIS 6

    Hi,

    This is my first post here and I am pleased to find a place dedicated to IIS AND PHP.
    My problem is one that has been going around for a long time as far as I can see by doing searches on google. I have a Windows 2003 SP2 server with IIS 6 installed and PHP 5. All is working fine, DB access, etc.... Apart from uploading large files (that is > 1Mb).

    I found several people always asking the same question and I think I might have tried all the possible answers to this problem.
    I have done the following with no success:

    • changed PHP.INI post_max_size and upload_max_filesize variables to higher values (20M in this case)
    • edited MetaBase.xml and changed the AspMaxRequestEntityAllowed variable to accept 10Mb (I think this variable is only for ASP though), added another variable MaxRequestEntityAllowed also set to 10Mb

    Despite any server restart, IIS reset, server-kicking, nothing works. Any File can be uploaded without a problem as long as they are less than 1Mb. Past that size, FireFox displays "The connection was reset" and IE displays "The page cannot be displayed" straight after hitting the submit button (browsers don't even try to think)
    I repeat once again that my forms and everything else works fine as long as the file being uploaded is less than 1Mb. I have the exact same script on our beta server running Windows 2000 and IIS 5 and everything work as it should.

    I am not trying to point a dirty finger at anybody but this is a frustrating problem that just does not seem to have a solution. If any MS guru is around or if anybody sorted this issue, I would like some pointers.

    Thanks for reading, Alex 

  • 12-20-2007, 10:06 AM In reply to

    • brashquido
    • Top 25 Contributor
    • Joined on 05-21-2006, 8:31 PM
    • Australia
    • Posts 153
    • IIS MVPs
    • brashquido

    Re: PHP file upload on IIS 6

    Hi Alex,

    There is at least one other place you can get dedicated support for IIS and PHP (<shameless_plug>see my sig</shameless_plug>).

    Anyway...

    Firstly, how have you got PHP for IIS configured, CGI, FastCGI, ISAPI? If using the new FastCGI handler what version are your using? I do seem to remember reading about a 1MB limit on POST data in one of the earlier technical preview versions. Another thing to check would be your script timeout and memory consumption settings in php.ini. If the files being uploaded are failing at exactly the same byte count then it is unlikely to be a timeout issue, but still worth checking. Have you tried using a simple HTML based upload form to try and pin down the problem as an IIS or PHP config issue?

     

    ----------------
    Dominic Ryan
    Microsoft IIS MVP
    www.iis-aid.com
    My IIS articles
    My PHP articles
    My How-to guides
  • 12-20-2007, 10:27 AM In reply to

    • axelay
    • Not Ranked
    • Joined on 12-20-2007, 5:53 AM
    • Posts 5
    • axelay

    Re: PHP file upload on IIS 6

    Hello brashquido,

    Thanks for getting back to me.

    I have configured PHP to use ISAPI but the problem doesn't come from that at all it seems.
    I have created a simple HTML upload form pointing to an ASP file on the server. The ASP is only set to receive the file and nothing more. Same problem, it breaks when I try to upload a file over 1Mb. So I was wrong in thinking this was a problem with PHP only...

    As previously mentionned, the browser doesn't do anything when the file I am trying to send is over 1Mb, it just goes straight to the error page or IE or FF. No data is being uploaded at all so it isn't a timeout issue either...

    I am confused about what can go wrong on the server. It now seems to me this is a global configuration problem rather than specific PHP error.

    Waiting to hear from you, Alex

    PS: I checked your website, might come handy ;)
     

  • 12-20-2007, 2:06 PM In reply to

    • brashquido
    • Top 25 Contributor
    • Joined on 05-21-2006, 8:31 PM
    • Australia
    • Posts 153
    • IIS MVPs
    • brashquido

    Re: PHP file upload on IIS 6

    I've never experienced this myself, so not really sure. I've had a bit of a look through the IIS metabase properties list and can't see anything there that should be preventing you from uploading files over 1MB in size. Do you have FrontPage installed as I read quite a lot of forum posts referring to a MaxUploadContentLength value that can cause this issue?

    ----------------
    Dominic Ryan
    Microsoft IIS MVP
    www.iis-aid.com
    My IIS articles
    My PHP articles
    My How-to guides
  • 12-24-2007, 9:38 AM In reply to

    • axelay
    • Not Ranked
    • Joined on 12-20-2007, 5:53 AM
    • Posts 5
    • axelay

    Re: PHP file upload on IIS 6

    Hi again,

    I have checked and cannot find any Frontpage extensions installed.
    This is driving me nuts I got to admit... Nothing I do will enable this to work and I find it rather difficult to believe nobody has found a solution just yet. Maybe the Vista IIS 7 took the priority but 2003 has been around for a while and should have had this problem before...

    I will continue investigate by checking the google web but will widen my searches as I was limiting myself to PHP.

    Will keep you posted and Merry Christmas to you all ;)

    Alex
     

  • 12-24-2007, 9:53 AM In reply to

    • axelay
    • Not Ranked
    • Joined on 12-20-2007, 5:53 AM
    • Posts 5
    • axelay

    Re: PHP file upload on IIS 6

    That was actually quite quick...

    http://www.gleamtech.com/support/forums/showthread.asp?TID=795

    In fact I modifed only the ASPMaxRequest variable but the other one had to be modifed as well. Read the first post and all works a chram now ;)

    Alex
     

  • 01-21-2008, 7:12 AM In reply to

    • aliggl
    • Not Ranked
    • Joined on 01-21-2008, 11:51 AM
    • http://www.GlobalGuideLine.com
    • Posts 3
    • aliggl

    PHP database file suggestion

    Hi Alex,

    its Ali i have a website and i want to make it dynamic with using Microsoft Access because i have no large data to handle on back end if you would guide me how to use MS Access file as backend with out making DNS, it would be a great favor for me.

    I just want to give a functionality of registration online just for this purpose i hope a small database is suitable for me to attach with my online website.

    If you have any better solutions then also please tell me.

    Thanks. For reading my post please reply.

    Ali.

     

    webmaster http://www.GlobalGuideLine.com
  • 01-23-2008, 4:15 AM In reply to

    • axelay
    • Not Ranked
    • Joined on 12-20-2007, 5:53 AM
    • Posts 5
    • axelay

    Re: PHP database file suggestion

    Hi Ali,

    Rather than using Access I would suggest you use MySQL which is more flexible and easier to use. MS Access has been designed to hold data on a client computer and never was intended to be driving a website although it is possible.

    Give it some thoughts

    Alex 

Page 1 of 1 (8 items)
Page view counter