Wednesday, April 9, 2008

PHP File Upload Stalemate!

In one of the projects that I have been working on that I've been most hopeful about keeps leading me to one error after another in a stalemate!

This project involves file uploads to a server.

I am doing this with an Apache Server (on Mac OSX) and PHP 5.

I've successfully - or so I think - reconfigured the php.ini file to allow for the capability to upload larger files.

Which is almost identical to this php.ini example, except for the following directives:

memory_limit = 8M
post_max_size = 8M
upload_max_filesize = 2M

Which I've changed to:

memory_limit = 8000M
post_max_size = 7000M
upload_max_filesize = 6000M

And now when I try to upload a large file, which is a .dv video file (one of the larger files I first came across on my computer)... I get the following in my HTTPD/error_log:

[error] PHP Warning: POST Content-Length of 363120480 bytes exceeds the limit of -1249902592 bytes in Unknown on line 0

Now 363120480 bytes is about 346.3 M and is the approximate size of the file I'm trying to upload.

But 1249902592 bytes is 1192 M, and that doesn't match any of the limits I've set in my php.ini file!

Plus 346.3 M < 1192 M!!!

I don't know what's up with the 1249902592 byte-value being negated in the warning - it doesn't make any sense... or is it just a dash in front of the byte-value?

Also, the first time I tried to upload the .dv file the server timed out or something... and got the "this server dropped connection" (or similar) message in Safari.

But that only appeared the first time I tried to upload the file and didn't appear any time after... Which is Totally Bizzare!

I've tried looking in the httpd.conf file for any possible settings that might be hanging things up and countlessly poured over all the directives in the php.ini file... but to no resolve!

Even changing the PHP directive max_execution_time = 30 (because it would normally take about 30 seconds for the upload to fail) to max_execution_time = 300 does nothing... It will still fail after about 30 seconds.

Permalink/TrackBack:
http://bvanscoter.blogspot.com/2008/04/php-file-upload-stalemate.html

 

pages

legal information

privacy policy

We respect your privacy and promise to never sell, barter, share or rent your information to any unauthorized third party. By providing your contact information you are also requesting and agreeing to receive important information about future events. (You may unsubscribe at any time.)
view full privacy policy here

certification of authenticity

I certify that the information contained on this site is true and complete to the best of my knowledge and understanding, any discrepencies will be governed by the terms of use.

terms of use

Everything we provide is provided "as is" including but not limited to the implied warranties of merchantability or fitness for a particular purpose, without any promise or guarantee of earnings. All forward looking statements on any of our materials are intended as an expression our opinion and will not responsible for any incidental or consequential damages from your actions.
view official terms of use