Echoing fatal errors in Unix vs. Windows

B

Bob

Ok... I'm a windows guy and woefully weak in Unix skills.

WHen I run a script on my windows IIS server, and Perl script
errors (e.g. coding problems) get echoed back to the browser.
When I load the same programs on my ISP's Linux server, I
get "Internal Server Error, see log". Unfortunately, I don't
seem to have access to that log file in my virtual environment.

I assume this has something to do with std err vs. std out and
where that output goes - but that's about the limit of my Unix
knowledge. How can I redirect the error output to dump back to
the browser ?

Thanks,
 
A

Alexandre Jaquet

Bob a écrit :
Ok... I'm a windows guy and woefully weak in Unix skills.

WHen I run a script on my windows IIS server, and Perl script
errors (e.g. coding problems) get echoed back to the browser.
When I load the same programs on my ISP's Linux server, I
get "Internal Server Error, see log". Unfortunately, I don't
seem to have access to that log file in my virtual environment.

I assume this has something to do with std err vs. std out and
where that output goes - but that's about the limit of my Unix
knowledge. How can I redirect the error output to dump back to
the browser ?

Thanks,

Hi use
print "Content-type: image/html\n\n";
print "$var";
 
S

Scott Bryce

Alexandre said:
It will be better to use

print "Content-type: text/html\n\n";
print "$var";

How would this cause fatal errors to be echoed in the browser?
 
T

Tintin

Alexandre Jaquet said:
Scott Bryce a écrit :

It will be better to use

print "Content-type: text/html\n\n";
print "$var";

You have a bizzare definition of "better".

See what happens when you try running the following 2 Perl CGI scripts and
then tell me which is better.

#!/usr/bin/perl
use strict;
use CGI;

my $q = new CGI;
print $q->header;
print $q->h1("Hello World");
stuffup=foobar;

#!/usr/bin/perl
use strict;
use CGI;
use CGI::Carp qw(fatalsToBrowser);

my $q = new CGI;
print $q->header;
print $q->h1("Hello World");
stuffup=foobar;
 
T

Tad McClellan

How can I redirect the error output to dump back to
the browser ?


perldoc -q error

My CGI script runs from the command line but not the browser. (500
Server Error)

How can I get better error messages from a CGI program?
 
J

Joe Smith

Alexandre said:
Bob a écrit :



print "Content-type: image/html\n\n";
print "$var";

That is so very wrong.
*) "image/html" is gibberish
*) The print() statement will not be executed if there is an
error that causes perl to abort.

The other people answering Bob's question have it right.
-Joe
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top