APACHE on Linux: Malformed Header error is killing me!!!

APACHE on Linux: Malformed Header error is killing me!!!

Post by Jay Power » Sat, 06 Apr 1996 04:00:00



Please help! I'm trying to run a simple CGI script (written in Perl) to receive some input from an HTML
form, and e-mail it to me.

Right now, I'm trying to get this little setup to work on my Linux machine, before I send it to my
internet machine.  I keep getting this malformed header error, and I'm CERTAIN that everything is ok in
my script-- to prove this, I've even gotten samples of some of the simplest scripts I could find, and
they don't work either.

Is there anything I'm doing as far as my Apache configuration is concerned that could cause this error?
My log file always says something like: access to /home/httpd/cgi-bin/survey.pl failed for 127.0.0.1,
reason: malformed header from script.  Then, the following error is returned on my HTML browser: Server
Error.  The server encountered an error or misconfiguration and was unable to complete your request.

occurred, and anything you might have done that may have caused the error.

If you can help, I'd really appreciate it!!


Thanks,
Jay

 
 
 

APACHE on Linux: Malformed Header error is killing me!!!

Post by Edgar Matzing » Wed, 10 Apr 1996 04:00:00




> Is there anything I'm doing as far as my Apache configuration is concerned that could cause this error?
> My log file always says something like: access to /home/httpd/cgi-bin/survey.pl failed for 127.0.0.1,
> reason: malformed header from script.  Then, the following error is returned on my HTML browser: Server
> Error.  The server encountered an error or misconfiguration and was unable to complete your request.

> occurred, and anything you might have done that may have caused the error.

> If you can help, I'd really appreciate it!!


> Thanks,
> Jay

Hi Jay,

   You did not include your PERL script to be sure, but i've noticed these
errors whenever I'd omitted the header part from the output. To make things
a bit clearer a little example (from the NCSA's CGI examples):

:   #!/bin/sh
:
:   DATE=/bin/date
:
:   echo Content-type: text/plain
:   echo
:
:   if [ -x $DATE ];  then
:           $DATE
:   else
:           echo Cannot find date command on this system.
:   fi

The line `echo Content-type: text/plain' and the empty line following it is the
header I mentioned above. If you leave this out you'll get the error you have.
If you have these, or similar, lines in your PERL script make sure they are
echoed to your httpd, Apache in your case.

As YMMV, hope to be of any help, good luck,

--
Edgar.

Two bytes merged into nothing: the byte and anti-byte.

    |\  /| :                                : Address: Philips CE B.V.
 /  | \/ | :     Edgar R. Matzinger         :          t.a.v. E.R. Matzinger
/   |    | :                                :          building: SFJ-6.58
\  /|  /\| :                                :          P.O. Box 218
 \/   /  \ :  Philips Consumer Electronics  :          5600 MD Eindhoven
  \  /\  / :   Advanced Development Centre  :          The Netherlands
   \/ |\/  : Integrated Circuits Laboratory :   Email:

Disclaimer: Any comments, opinions made are mine, etc ...