C Board  

Go Back   C Board > Community Boards > Tech Board

Reply
 
LinkBack Thread Tools Display Modes
Old 09-08-2005, 10:51 PM   #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?
ChadJohnson is offline   Reply With Quote
Old 09-22-2005, 02:02 AM   #2
Owner of 4 UK banks
 
Join Date: Sep 2004
Posts: 116
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.
__________________
Ah ma wee hach patew mae bo clee hach maneagh
Heow meow meow meow meow meow meow meow BARK meow
Saigh hough loo loo cheow dach hagh vreigh chouach mouheaugh
Douauh meah mae couchah moo ma meagh pach hooragh

- Gaelic Song, by The Arrogant Worms
Ask a friend for a translation
Driver is offline   Reply With Quote
Old 09-22-2005, 08:29 AM   #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.

Quote:
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 08:33 AM.
ChadJohnson is offline   Reply With Quote
Old 09-22-2005, 12:59 PM   #4
Owner of 4 UK banks
 
Join Date: Sep 2004
Posts: 116
Quote:
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!
__________________
Ah ma wee hach patew mae bo clee hach maneagh
Heow meow meow meow meow meow meow meow BARK meow
Saigh hough loo loo cheow dach hagh vreigh chouach mouheaugh
Douauh meah mae couchah moo ma meagh pach hooragh

- Gaelic Song, by The Arrogant Worms
Ask a friend for a translation
Driver is offline   Reply With Quote
Old 09-22-2005, 06:00 PM   #5
Chad Johnson
 
Join Date: May 2004
Posts: 154
Do you think using Apache rather than IIS might make a difference?
ChadJohnson is offline   Reply With Quote
Old 09-23-2005, 02:26 AM   #6
Owner of 4 UK banks
 
Join Date: Sep 2004
Posts: 116
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.
__________________
Ah ma wee hach patew mae bo clee hach maneagh
Heow meow meow meow meow meow meow meow BARK meow
Saigh hough loo loo cheow dach hagh vreigh chouach mouheaugh
Douauh meah mae couchah moo ma meagh pach hooragh

- Gaelic Song, by The Arrogant Worms
Ask a friend for a translation
Driver is offline   Reply With Quote
Old 09-23-2005, 08:57 AM   #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.
ChadJohnson is offline   Reply With Quote
Old 09-25-2005, 11:02 AM   #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.
Jaqui is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

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


All times are GMT -6. The time now is 10:22 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

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