I am trying to run a file upload using PHP as a CGI script and am running
into an odd error.

The error I am getting is the dreaded Server Error -- Error 500 Premature
end of script headers: php.cgi

Here is the diagnosis I have done.

1.  The php.cgi executable deals with scripts correctly when using the GET
method.
2.  The php.cgi script deals with POST method requests properly when the
     enctype is NOT multipart/form-data

This rules out suexec type errors.  (in any case the suexec log shows
everything is good).

3.  File uploads using the mod_php work fine (this rules out apache not
accepting the file)

4. the CGI log shows the request being sent to the script, and that there is
no result.

5. The above error is not script dependent, the error occurs with a on-line
script
    that prints the string "it ran" when the form enctype is
multipart/form-data.

6.  The upload script is being taken from a different box running different
versions of apache/php
     and the script works correctly there.

I have tried this with various version of php all with the same results.  I
have built it with php.4.3.10.

Here are the configure options from the phpinfo report:
'./configure' '--enable-force-cgi-redirect' '--with-openssl' '--with-curl'
'--with-mysql' '--with-cgi'
'--with-pfpro=/home/wayne/verisign/payflowpro/linuxrh9' '--with-gd'
'--with-jpeg-dir' '--with-zlib-dir' '--with-xpm-dir' '--with-freetype-dir'
'--enable-ftp'

I have the following file variables set:
error_reporting 2039
file_uploads On
log_errors On
max_input_time -1
post_max_size 8M
safe_mode off
upload_max_filesize  2M
upload_tmp_dir  /tmp


Any Ideas?

Thanks in Advance
Wayne

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to