cgi DBI Oracle errors


P

philip.kingsten

Hello,
How can I get hold of the errors from a CGI below. It works fine on
the command line - but fails silently when invoked via cgi? The query
just ask for a describe on a table.
Thanks for your help...

Phil

#!/usr/local/bin/perl

use strict;
use warnings;
use CGI::Carp qw(fatalsToBrowser);
use CGI ':standard';
use DBI;
my $dbh = DBI->connect( 'dbi:Oracle:FRED',
'bert', 'bert', { RaiseError => 1, AutoCommit => 0 }
) || die "Database connection not made: $DBI::errstr";
....
 
Ad

Advertisements

P

philip.kingsten

Hello,
How can I get hold of the errors from a CGI below. It works fine on
the command line - but fails silently when invoked via cgi? The query
just ask for a describe on a table.
Thanks for your help...

Phil

#!/usr/local/bin/perl

use strict;
use warnings;
use CGI::Carp qw(fatalsToBrowser);
use CGI ':standard';
use DBI;
my $dbh = DBI->connect( 'dbi:Oracle:FRED',
'bert', 'bert', { RaiseError => 1, AutoCommit => 0 }
) || die "Database connection not made: $DBI::errstr";
...

I now know that it is this last line that causes the problem - I get a
"cannot execute contact your sysadmin from the web server" if I
include this line - and no error if I inlcud ethe line above.
As this works on the commandline but not here I suspect the
environment - Please how can I dump the environment?
 
Ad

Advertisements

T

Tad J McClellan

I now know that it is this last line that causes the problem - I get a
"cannot execute contact your sysadmin from the web server" if I
include this line - and no error if I inlcud ethe line above.
As this works on the commandline but not here I suspect the
environment -


I suspect that your CGI program does not run as the same user as
when you tried it from the command line...

Find out what user it is running as:

warn "user is ", scalar(getpwuid $<), "\n";

Please how can I dump the environment?

print "$_ => $ENV{$_}\n" for sort keys %ENV;
 

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

Top