?
Solved

CGI Error: explanation needed..

Posted on 2002-07-07
21
Medium Priority
?
201 Views
Last Modified: 2013-12-25
hi all,

i don't really do CGI programming and im not doing it now.  im just wondering about a CGI error coming from a program i installed into an IIS server.
the error is shown below.

thanks in advance,
e.

<error begin>
CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:
<error end>
0
Comment
Question by:3Mann
[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
  • 6
  • 5
  • 4
  • +2
21 Comments
 
LVL 1

Author Comment

by:3Mann
ID: 7136570
more info:

the IIS server runs in Win NT Server 4.0
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7137280
your CGI did not produce a header like:

Content-Type: text/html\n\n
0
 
LVL 5

Expert Comment

by:Peewee
ID: 7137361
3Mann,

yes ahoffmann is likely to be correct here look at the presence of a content line.

Content-Type: text/html\n\n

Fialing this make sure you have the correct permissions and the path to perl is correct.

or the path to perl is correct, ie check /usr/bin/perl or whatever you have actually points to perl.


If all these fail, make sure a basic cgi perl works on your server: ie

#!/usr/bin/perl

print "Content-Type: text/html\n\n";
print "Hello World";


let me know how you get on..
regards
Peewee
0
DFW AZURE MEETUP TONIGHT FRI 6PM

We will be discussing what Azure Stack is, how does it fit into the suit of offerings that Azure has currently, and where can it fit into your organizations technology stack. We will also be discussing limitations of the platform while covering various applicable scenarios.

 
LVL 11

Expert Comment

by:mouatts
ID: 7139323
I think it is more likely that execution of the CGI failed completely.

Had it output anything then I would expect it to appear within the error message even if it wasn't a valid header.

Moreover I don't thnik IIS actual checks the HTTP header message passed by a CGI. But what it does detect is that the CGI has 'ended' without outputting anything.

0
 
LVL 5

Expert Comment

by:Peewee
ID: 7159189
3Mann,
did you get the answer u were looking for?

regards Peewee
0
 
LVL 1

Author Comment

by:3Mann
ID: 7161523
hi guys,
isn't it a problem with the IIS settings?

i tried it before and it was running, though now, the program i installed would output that error.
i couldn't do anything though regarding CGI/perl since its a third-party program and can't do any CGI recoding for that.

i tried ticking the checkbox for allowing execution of scripts but still the error is the same.
0
 
LVL 5

Expert Comment

by:Peewee
ID: 7161763
3Mann,

assuming your IIS setting are correct then the problem will be either:

A:
===============================
your path to perl is incorrect:

#!/usr/bin/perl

print "Content-Type: text/html\n\n";
print "Hello World";

in the example here perl is expected to be at /usr/bin/perl on a unix system or C:\usr\bin\perl.exe on a windows system.

Solution:
for unix simple do a perl -v for windows check where the perl.exe is located.

B:
incompatable Line endings:
Windows and Unix have different line endings, make sure that if you ftp your program anywhere you have the correct settings, for line endings and ASCII for scripts or binary for images. This problem may occur if you have developed
 on one machine and are planning to run your scripts on another.

Here's what to do:
execute this script below and ensure permissions are 775 the line endings are correct for the operating stystem and
perl is located where the cgi script is teliing the server.


let me know how you get on..
reagrds Peewee
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7162060
ftp ASCII mode is not reliable, make shure the file is in correct format on the sender, then ftp it using bin mode.
0
 
LVL 11

Expert Comment

by:mouatts
ID: 7162630
>ftp ASCII mode is not reliable

Absolute nonsense.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7163370
mouatts, try following in a file:

   print "enclosed in ' is a real newline 'NL' character";

(NL means: 0x0a)
then transfer (probably from a Windoze ftp client) the file in ASCII mode, and rethink your statement
0
 
LVL 11

Expert Comment

by:mouatts
ID: 7164186
I presume you mean to a windows machine. But yes it will convert to CRLF. But that is perfectly correct because you have effectively created the file as a 'binary file'. Within your example this would be correct because 0x0A is NOT a real newline character it is the Linefeed character (considering LF to be a newline character is very much a unixism) . By converting it the result would actually be correct on each machine - 0A on Unix and 0D0A on Windows etc.

Transfer your example to a windows machine via binary and it won't work, but this doesn't mean that the binary mode is unreliable just that you have used the wrong format!

Making the decision to use either Binary or ASCII mode does require you to know the format of the file that you are going to transfer. Most languages support character constants and programmers should use them to avoid the potential problems caused by using the numeric equivelents. Having said that it is a great shame that Perl/C etc don't support \l for a linefeed forcing you to use \0x0a.

Steve



0
 
LVL 1

Author Comment

by:3Mann
ID: 7167439
i appreciate all the answers guys but i was merely installing a software =D

i read the SW requirements of the product and its reqs are only NTServer and IIS.  No mention of perl.exe or any other.  Am i missing something?

Sorry for my naiveity... =D

cheers,
3Mann
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 7167494
3Mann, sorry for being off-topic.

> read the SW requirements of the product and its reqs are only NTServer and IIS.
And in which language/type are your CGIs? Could you please check in your cgi-bin directory.
0
 
LVL 11

Expert Comment

by:mouatts
ID: 7167510
If the cgi is an exe make sure that the user under which IIS runs has execute permissions on the program and that within IIS execute permission is turned on for the directory in which the cgi is stored.

Steve
0
 
LVL 5

Expert Comment

by:Peewee
ID: 7176687
3Mann,

in my first post i wrote:

#!/usr/bin/perl

print "Content-Type: text/html\n\n";
print "Hello World";


make this into a program and run in and see what happens, this will tewst if your server is ok with CGI.

You would be well advised to rule this out first of all.  You of course will need perl.exe installed on your machine, and for this script it is expected at c:\usr\bin\perl.exe

If it is anywhere else this script will not work.


try this and report back exatly what you see. Thius may sound silly be this will save you you an awful lot of time an effort.

regards Peewee
0
 
LVL 5

Expert Comment

by:Peewee
ID: 7194139
3Mann,

did u get the answer u were looking for?

regards Peewee
0
 
LVL 5

Expert Comment

by:Peewee
ID: 7283621
3Mann,

did u get the answer u were looking for?

if so, would you care to share your solution with us?

regards Peewee
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 11832822
hmm, that's exactly what I said in http:#7137280
0
 
LVL 1

Author Comment

by:3Mann
ID: 11849325
Sorry guys.  Was just able to come back to this question just now.

regarding the question of peewee:
>did u get the answer u were looking for?
>if so, would you care to share your solution with us?

i actually had this problem when using the client-server antivirus software.
there was no solution as we just used another software.

now how do i give points to this?
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 11863116
PAQed, with points refunded (30)

modulo
Community Support Moderator
0

Featured Post

Automating Terraform w Jenkins & AWS CodeCommit

How to configure Jenkins and CodeCommit to allow users to easily create and destroy infrastructure using Terraform code.

Question has a verified solution.

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

Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
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…
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…
Suggested Courses

765 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