Solved

Error "malformed header from script"

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
Ever wondered how to display how many visitors you have online. In this tutorial I will show you an easy but effective way to display the number of online visitors in WhizBase. In this article I assume you have read my previous articles and know …
The viewer will learn how to dynamically set the form action using jQuery.
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)

708 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