Solved

Error "malformed header from script"

Posted on 1998-11-29
4
269 Views
Last Modified: 2013-12-25
I have a webpage that calls a cgi program which calls another
exe. Everything works fine except when the cgi program
writes back status to the browser, I get this error:"malformed header from script. Bad header=Login return OK". What does
this mean ?  I try to run the cgi from command line (interactively) it works fine. My server is
Apache 1.3.2 running on UNIX.
0
Comment
Question by:trinh
4 Comments
 
LVL 1

Expert Comment

by:ptruman
ID: 1829823
Are you making sure the 2nd program execs with no stdout
output?
Try using `catch`, or redirecting stdout to >/dev/null
If either program generate any "not expected" output,
you will get the "malformed header" error.

Programs like this DO work on the cmd line, but dont
product "web compatible" output....

0
 

Expert Comment

by:bobline
ID: 1829824
Your script should return "Content-type: text/html\n\nLogin return Ok", where "\n" means new line.
0
 

Author Comment

by:trinh
ID: 1829825
My second program doesn't have any stdout outputs.
It used to work for me before but I just reisntall the OS and the ApacheServer
and now it start giving me the "malformed header". Where do you find the
document describing this "malformed header" situation.
0
 
LVL 11

Accepted Solution

by:
mouatts earned 50 total points
ID: 1829826
The malformed header simply means that the output from the CGI has not been recognised by the server as a valid HTTP header.

This is most often caused by a CGI crashing or something being output to stderr.

Check that both programs run correctly independently of the Web Server. As you have just re-installed your OS it could be something as simple as a file permission or a missing library/file.

Steve
0

Featured Post

The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hope you'll find this tutorial useful and interesting. So let's try to extend Tcl with a new package.  For anyone more deeply interested please check out the book "Practical Programming in Tcl and Tk". It's really one of the best written books abo…
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question