I don't mind sharing my woes. This is probrably a lot more information than you wanted, but I am desperate for a solution.
I have two production servers running the exact same version of Linux (9.0), Apache (2.0.40) and PHP (4.2.2)
I have a web application running on both servers. Last week we needed to enhance the app to allow users to upload images and pdf files.
I first implemented a PHP form with form field of file. It will only upload small files. Anything bigger than 10K, it corrupts and ends up being about twice the size it should be.
I spend three days reading about apache and php configuration issues. I then decided to implement a temporary interim solution. So I created a perl script, also utilizing the apache form/file method. That page also will upload small files. But when I try to upload anything greater than 7k it just hangs uploading the file. Therefore, I am inclinded to suspect apache as the problem.
FYI, I have another server running Apache 1.3.27 and php 4.2.3 and both scripts (the php and the perl) work correctly on it. I even uploaded a 6 meg file using both with no problem.
If you know anyone who might have some suggestions, my stuff is configured as:
My PHP has the following configuration:
php.conf has SetOutputFilter PHP, SetInputFilter PHP, LimitRequestBody 35000000
php.ini has the following configuration after tweaking everything I could think of:
always_populate_raw_post_data = true
default_charset no value
default_mimetype = text/html
max_execution_time = 3600
memory_limit = 16000000
post_max_size = 16000000
register_globals = on
upload_max_filesize = 35000000
My Form Code is:
<form enctype="multipart/form-data" action ="upload2.php" method="POST"><hr>
<input type="hidden" name="MAX_FILE_SIZE" value="16000000">
<input name="userfile" type="FILE" size="45">
<input type="submit" value="Send File"><br>
</form>
My upload php file contains the following:
if (is_uploaded_file($FILES['userfile']['tmp_name']))
{
// move the file to the permenant dir
$IMGPATH = "/var/www/html/cust/images/";
$fullname = $IMGPATH . $FILES['userfile']['name'];
copy($_FILES['userfile']['tmp_name'], $fullname );
}
Thanks for any suggestions.