Red Hat Bugzilla – Bug 97647
Files uploaded with php double in size (approx) and end up corrupt.
Last modified: 2007-04-18 12:54:53 EDT
Description of problem: I moved my old php application to redhat v9 and my
uploaded files were getting corrupted. The file size of the uploaded document
was approximately 2X that of the original. To work around this problem I built
php from source and now uploaded files are once again ok.
Version-Release number of selected component (if applicable):
Should be easy.
Steps to Reproduce:
1. Install Redhat9 with php, mysql and apache.
2. Install a php script that handles file uploads into Apache's doc root.
3. Upload a file and try opening it. Also, compare the size to the original.
File cannot be opened and the uploaded file is 2X as large as the original.
Can you attach your /etc/httpd/conf/httpd.conf and /etc/httpd/conf.d/php.conf
files? This can happen because of a configuration error.
Created attachment 92476 [details]
My apache config.
Created attachment 92477 [details]
My php config.
Thanks. You've added the line:
AddType application/x-httpd-php .php
to httpd.conf - this is known to cause problems with the symptoms you describe.
Can you remove this and try your scripts again?
Without that line in the httpd.conf, the script does not seem to run properly
and I end up with most of the code echoed to the screen. The install notes for
php indicate that the line needs to be there. Also, the version I built from
source works fine with that line in the httpd.conf.
Please let me know if I missed something or misunderstood the request.
That shouldn't happen. You've also added the line:
LoadModule php4_module modules/libphp4.so
to your httpd.conf - if PHP does not work without that line, then your
file is not getting loaded.
This is likely a duplicate of bug 82967, for which an erratum was just issued.
*** This bug has been marked as a duplicate of 82967 ***
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.