A Perl CGI that connects to an Oracle database via
DBI,
DBD::Oracle works at the command line
but not via a browser.
It is like it
is looking for Perl modules in a location different
than that at the command line.
Environment:
RHEL 4 AS
Oracle Client 10.2.0
Apache 2.0.52 (without mod_perl)
Perl 5.8.5
Perl DBI version
1.50
Perl DBD::Oracle version 1.16
The Perl script executes a DBD::Oracle
connection to a database. The script
executes fine from the command line, but execution
within a browser
yields the
following:
"install_driver(Oracle) failed: Can't load '/usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libclntsh.so.10.1: cannot open shared object file: No such file or directory at /usr/lib64/perl5/5.8.5/x86_64-linux-thread-multi/DynaLoader.pm line 230.
Compilation failed in require at (eval 9) line 3. Perhaps a required shared library or dll isn't installed where expected at /web/dwhse/gl/gl_status.cgi line 84"
I tried to add the following to the Perl
script; made no difference:
use CGI
qw/:standard/; # CGI helper functions
use
Time::Local; # for time
calculations
use DBI;
use CGI::Carp qw(fatalsToBrowser);
use lib "/usr/lib64/perl5/site_perl/5.8.5";
use lib
"/u01/app/oracle/oracle/10.2.0/lib";
$ENV{'LD_LIBRARY_PATH'} =
"/u01/app/oracle/product/10.2.0/lib";
$ENV{'ORACLE_HOME'} =
"/u01/app/oracle/product/10.2.0";
$ENV{'ORACLE_SID'} =
"prod";
Diana Shepard
University of Colorado, Boulder