CGI Error: explanation needed..

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>
LVL 1
3MannAsked:
Who is Participating?
 
moduloCommented:
PAQed, with points refunded (30)

modulo
Community Support Moderator
0
 
3MannAuthor Commented:
more info:

the IIS server runs in Win NT Server 4.0
0
 
ahoffmannCommented:
your CGI did not produce a header like:

Content-Type: text/html\n\n
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

 
PeeweeCommented:
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
 
mouattsCommented:
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
 
PeeweeCommented:
3Mann,
did you get the answer u were looking for?

regards Peewee
0
 
3MannAuthor Commented:
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
 
PeeweeCommented:
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
 
ahoffmannCommented:
ftp ASCII mode is not reliable, make shure the file is in correct format on the sender, then ftp it using bin mode.
0
 
mouattsCommented:
>ftp ASCII mode is not reliable

Absolute nonsense.
0
 
ahoffmannCommented:
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
 
mouattsCommented:
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
 
3MannAuthor Commented:
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
 
ahoffmannCommented:
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
 
mouattsCommented:
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
 
PeeweeCommented:
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
 
PeeweeCommented:
3Mann,

did u get the answer u were looking for?

regards Peewee
0
 
PeeweeCommented:
3Mann,

did u get the answer u were looking for?

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

regards Peewee
0
 
ahoffmannCommented:
hmm, that's exactly what I said in http:#7137280
0
 
3MannAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.