Ryan Speight <[EMAIL PROTECTED]> wrote:
Andrew,
    Can you shoot me your code and I will take a look at it.  Also, please give me a summary of what you are attempting to do.  Keep in mind that that is a generic error message if a program can't compile.  Also, try runninging it locally.  Copy the file down to your local machine, then type the following.
 
perl ProgramName.cgi > test.html
 
This will output everything to the test.html file which you can open locally with Internet Explorer to see what the output looks like.  you can also run it with the command:
 
perl -d ProgramName.cgi
 
this will open it in a debugger window and you can step through each line to find your error.
 
This all assumes that the program can even run/compile.  To find this out just use the good old
 
perl ProgramName.cgi and it will give you any error messages for items it encounters.  If you see several of them, don't get discoraged.  Usually there are only a handful of errors that feed off of each other.  For example, you may be missins a simicolon at the end of one line and this flags an error for all subsequent lines so always work from the top down looking for the error with the lowest line number.
 
Welcome to Perl, it is a great language but it will take some getting used to. 
 
Also, as I said before, I will be happy to take a look at your code for you it you want to email it to me.
 
-Ryan 

Andrew Derry <[EMAIL PROTECTED]> wrote:

Hi Ryan,

 

Thanks for the reply, and for the suggestion!  J

 

It didn’t quite work, and I suspect because the CGI isn’t even getting off the ground, so to speak, and is immediately spitting out an error.

 

However, I think your idea may still work for me in a slightly different way… Do you know if and how I can call one CGI from another? -- So I could run one CGI, that printed the headers, and then just pass control to the next (real) CGI, which then spits out the error, so I then have my proper headers and the error going to the browser… Do you know what I mean?

 

I’m quite new to Perl, and CGI for that matter.. if you didn’t get that already from my questions. ;)  So.. well, I totally appreciate the help. So if you don’t know how to do the CGI thing but if you even just think it might work, just let me know, and I’ll try to figure out how..

 

I tried using just system, so I whipped up a little cgi with your two lines at the top, and then just system “myprogram.cgi” - but for some reason that does the same thing (as in, it dies immediately and returns an error, and I get the same “CGI Error - …” with no errors included)

 

I even put a simple print statement in the file, and if I comment out the system line, it runs and prints fine, but if I uncomment the system line, the whole thing dies. :-/

 

As I say.. thanks again very much for the suggestion!  It may yet lead me to an answer!  ;)  If you have another idea or know how I can do what I’m trying to.. I’d totally appreciate hearing more from you!  If not.. well, I’ll keep trying and thanks again! J

 

Cheers

 

 - Andrew

 

 

--

Andrew Derry  -                          [EMAIL PROTECTED]

  Systems Consultant, Application Integration Support

  Simon Fraser University

  MBC1404 - 8888 University Drive

  Burnaby, BC, V5A 1S6 Canada

 

  604-291-5962


From: Ryan Speight [mailto:[EMAIL PROTECTED]
Sent: Monday, August 22, 2005 9:54 AM
To: Andrew Derry
Subject: Re: How to force IIS to return CGI errors?

 

Try putting

 

print "HTTP/1.0 200 OK\n";
print "Content-Type: text/html\n\n"; \

in the .pl file before you print anything to the screen.  I usually put this immediately after the library declarations.


Andrew Derry <[EMAIL PROTECTED]> wrote:

Hello,

 

I’m trying to debug a Perl CGI on a server. However, when my program has errors, IIS only returns the bit like:

“CGI Error - The specified CGI application misbehaved by not returning a complete set of HTTP Headers.”

 

When I debug locally on my PC and get errors, it says the same thing, but it ALSO goes on to say:

“The headers it did return are…. “ and lists the errors that the CGI returned.

 

Someone suggested that all I need to do is browse locally on the server to get IIS to return the errors -- however, this is not possible in the setup that we have - the server has multiple IPs and is behind a load balancer, etc. so you can’t browse locally at all.

 

Does anyone have any idea how I can force IIS to return the headers, or any other way I might get the error information so I can start to figure out what’s going wrong with my program?

 

I have tried posting to a Microsoft IIS newsgroup with no replies.

 

Any help or suggestions would be very much appreciated.

 

Thanks

 

 - Andrew

 

--

Andrew Derry  -                          [EMAIL PROTECTED]

  Systems Consultant, Application Integration Support

  Simon Fraser University

  MBC1404 - 8888 University Drive

  Burnaby, BC, V5A 1S6 Canada

 

  604-291-5962

 

_______________________________________________
Perl-Win32-Admin mailing list
Perl-Win32-Admin@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
Perl-Win32-Admin mailing list
Perl-Win32-Admin@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to