PHP/IIS Issue

This is a discussion on PHP/IIS Issue within the Tech Board forums, part of the Community Boards category; I made a web site this summer and it allows people to upload files up to 1GB to a web ...

  1. #1
    Chad Johnson
    Join Date
    May 2004
    Posts
    154

    Question PHP/IIS Issue

    I made a web site this summer and it allows people to upload files up to 1GB to a web server. The server runs PHP 4 (pretty recent), MySQL 4 (pretty recent too), and IIS 5.

    If you upload say a 100MB files sitting at the server (going to localhost), it works fine. However, if we try to upload that file from another computer with the same web interface, the file becomes corrupted (or something).

    The server is about 1 mile away from the remote one, going over a wireless connection. Using Windows Explorer, it takes about 5 minutes to send that file.

    So I tried using the following settings in php.ini:

    max_execution_time = 999999
    max_input_time = 999999
    memory_limit = 1024M
    post_max_size = 1024M
    upload_max_filesize = 1024M

    but no cigar. Any ideas? Could this be a setting in IIS? Does it sound like a web server issue or a PHP setting?

  2. #2
    Registered User
    Join Date
    Sep 2004
    Posts
    123
    Actually, PHP 5 is out (and has been for some time), and there are a number of new features, etc. from PHP 4.

    Many hosts still run under PHP 4 though, and it's still pretty up-to-date.

    Those settings to which you refer configure the parameters under which a script will run - it's not necessarily a good idea to bump them to the highest possible values. For example, max_execution_time should really be set to no more than about 30 seconds (it specifies how long a script can run for before the server throws a timeout error). Can be useful for debugging scripts which have got stuck into an infinite loop.

    In what way does the file become corrupted? If you examine the uploaded source, is it noticeably different from the original? Do you get an error when you try to execute the script?

    I'm not familiar with the installation and setting up of PHP, but a bit of judicious Googling has turned up this article here which may or may not be of help.
    I think you can put a signature here.

  3. #3
    Chad Johnson
    Join Date
    May 2004
    Posts
    154
    Hey, thanks a lot for the reply! Here's an e-mail correspondance (read from bottom to top). The "file vault" is the PHP application. This is over a wireless connection across town.

    Hi Larry,

    Well, I tried downloading it through the web interface and got a corrupted file as well. Then I simply copied the file using Windows Explorer and it worked. I guess it's not ready for prime time. Let me talk to Chad and see if he has any suggestions. I guess Apache is one thing we could try. That's the only thing I can think of. I'll let you know what he says.

    Brent
    --------------------------------------------------------------------------------
    Brent,

    The Adobe AR7 I downloaded was corrupt. Today I tried again. I first tried using wget like I do online. That did not work. Maybe if this was an Apache server it would work? I did get 11 MB of something. I tried again using the regular download routine, but again the final file has a checksum error and will not execute. (Either that or it did execute in which case who knows what I just loaded onto my machine?) At least I was a limited user at the time. I forgot that I might need to be an administrator to load the program.

    I think we need something that handles errors a bit better. We need to get a little more experience before going primetime.

    I just checked the two downloads against each other. They are not the same. One is 18.20 MB and the other 17.99 MB. Neither would execute. Obviously the MD5 and SHA-1 checks are different (I used FolderMatch to do the comparison). Both appeared to download completely.

    Larry
    --------------------------------------------------------------------------------
    Yeah, I know what you mean. I wonder if there is a setting somewhere that controls the speed. Maybe in IIS. It's still way faster than the VSAT.

    I've had some problems uploading large files to it. I could not upload MSN Messenger 7.5 to it last night from home. It just kept dying after a few minutes. I finally connected to the machine using Windows Explorer and just copied the file to its hard drive. Then I VNC'd in, opened the web page for the file vault via VNC, and uploaded the file directly from the hard drive. It worked fine. Not sure what is going on there. A bit inconvenient if you ask me. From our office it seems to work better, but not perfect.

    I still think it is a good idea to populate it with current software and have everyone using it.

    Brent
    --------------------------------------------------------------------------------
    Brent,

    I uploaded Audacity to the server. I also downloaded Adobe AR7. I am surprised at how slow the download is. It runs at about 1/10 what I expected. It took a couple minutes to download 17 MB (AR7). A friend in Phoenix has a 1 gig connection which would run about 1 MB per second. This link is running at 1/10 MB per second.

    Larry
    Last edited by ChadJohnson; 09-22-2005 at 09:33 AM.

  4. #4
    Registered User
    Join Date
    Sep 2004
    Posts
    123
    memory_limit = 1024M
    post_max_size = 1024M
    upload_max_filesize = 1024M
    Might be too big .... there could well be a limit of 20MB.

    A bit more searching turned up this thread on a different forum where those variables are discussed, and there's a link to the PHP site's discussion on the matter.

    However, this would not explain why it uploads under some circumstances but not others. It smacks of a problem with the wireless uploader, as if it somehow thinks it's had a successful transfer when in fact it hasn't.

    They also link to an article on How to optimize your PHP installation to handle large file uploads. That might throw a bit more light on the subject!
    I think you can put a signature here.

  5. #5
    Chad Johnson
    Join Date
    May 2004
    Posts
    154
    Do you think using Apache rather than IIS might make a difference?

  6. #6
    Registered User
    Join Date
    Sep 2004
    Posts
    123
    It might do, but I must confess I've never been involved with the setting up of servers, so please don't consider me an authority on the issue

    However, IIS is Microsoft's system and is probably better suited to using ASP (Active server Pages), so an Apache server may be the better option for you since it seems that most PHP sites I've come across are run on Apache platforms.

    Certainly that seems to be my experience: IIS -> ASP; Apache -> PHP.

    But IIS can support PHP (as you know); it may be that there is a setting somewhere that prevents/adversely affects those huge uploads from working on an IIS system that wouldn't be an issue on an Apache server.
    I think you can put a signature here.

  7. #7
    Chad Johnson
    Join Date
    May 2004
    Posts
    154
    Well hey thanks a lot for your input. It's just really strange that I can upload a file by accessing the web site from the comptuer the site is hosted on OR on a computer within the same wired LAN. It MUST either be a wireless connection issue or a setting somewhere either in PHP or IIS.

  8. #8
    Registered User Jaqui's Avatar
    Join Date
    Feb 2005
    Posts
    416
    php has just the one setting for filesize, unless your script itself limits the size, or time and transfer speed.

    if you can upload and download fine through the wired connection, it is definately a wireless settings problem.

    apache does have an asp module to allow it to serve asp pages.
    iis does have support for php
    iis may have a file transfer limit for upload size. ( no idea, I use apache )
    with apache, you do have to install php [ edit config to point to where php is on the server, add handlers to apache for the .php extention ] if on windows, install as cgi, since the module for apahe to work php internally is *x only, not working in windows.
    on *x, you can use the mod_php which is the apache dll for php. ( shared object actually )
    Quote Originally Posted by Jeff Henager
    If the average user can put a CD in and boot the system and follow the prompts, he can install and use Linux. If he can't do that simple task, he doesn't need to be around technology.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. float calculation issue
    By George2 in forum C# Programming
    Replies: 1
    Last Post: 05-26-2008, 05:56 AM
  2. type safe issue
    By George2 in forum C++ Programming
    Replies: 4
    Last Post: 02-12-2008, 09:32 PM
  3. Metaprogramming Issue
    By schultz in forum C++ Programming
    Replies: 8
    Last Post: 10-08-2007, 06:11 PM
  4. directsound issue
    By valis in forum Tech Board
    Replies: 0
    Last Post: 06-25-2006, 10:28 PM
  5. my first issue of GDM
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 09-12-2002, 05:02 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21