Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Error "malformed header from script"

Posted on 1998-11-29
4
Medium Priority
?
276 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 100 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

RHCE - Red Hat OpenStack Prep Course

This course will provide in-depth training so that students who currently hold the EX200 & EX210 certifications can sit for the EX310 exam. Students will learn how to deploy & manage a full Red Hat environment with Ceph block storage, & integrate Ceph into other OpenStack service

Question has a verified solution.

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

In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
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…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…

722 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