Solved

Error "malformed header from script"

Posted on 1998-11-29
4
275 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Quiz: What Do These Organizations Have In Common?

Hint: Their teams ended up taking quizzes, too.

Question has a verified solution.

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

This article will show, step by step, how to integrate R code into a R Sweave document
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

627 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