Solved

Error "malformed header from script"

Posted on 1998-11-29
4
268 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

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…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
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…

932 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now