Env:
Red Hat Enterprise Linux Server release 6.4
Apache/2.2.15 (Unix) mod_perl/2.0.4 Perl/v5.10.1
Perl v5.10.1 (*) built for x86_64-linux-thread-multi
64 bit Oracle client for 11.2
DBD::Oracle : Oracle Driver for DBI ; P/PY/PYTHIAN/DBD-Oracle-1.64.tar.gz : /usr/local/lib64/perl5/DBD/Oracle.pm : Installed: 1.64
/home/oracle/app/oracle/product/11.2.0/client_1/lib/libclntsh.so.11.1: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped
-rwxr-xr-x. 1 oracle oracle 48725761 Jun 10 17:41 /home/oracle/app/oracle/product/11.2.0/client_1/lib/libclntsh.so.11.1
Startup.pl
use lib qw(/home/oracle/app/oracle/product/11.2.0/client_1/lib);
BEGIN {
$ENV{ORACLE_HOME} = '/home/oracle/app/oracle/product/11.2.0/client_1';
$ENV{LD_LIBRARY_PATH} = '/home/oracle/app/oracle/product/11.2.0/client_1/lib';
$ENV{ORACLE_SID} = 'MARS';
}
print STDERR "\nORACLE_HOME = " . $ENV{'ORACLE_HOME'} . "\n";
print STDERR "\nLD_LIBRARY_PATH = " . $ENV{'LD_LIBRARY_PATH'} . "\n";
use mod_perl2;
use Apache::DBI ();
use DBI ();
use DBD::Oracle;
BEGIN { use Data::Dumper; print STDERR Dumper(\@INC); }
print STDERR "ModPerl2 Startup.pl\n";
foreach ( keys %ENV ) {
print STDERR "$_\t$ENV{$_}\n";
}
1;
Apache conf
PerlRequire /var/www/cgi-bin/startup.pl
SetEnv ORACLE_HOME "/home/oracle/app/oracle/product/11.2.0/client_1"
SetEnv LD_LIBRARY_PATH "/home/oracle/app/oracle/product/11.2.0/client_1/lib"
Error:
Can't load '/usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libclntsh.so.11.1: cannot open shared object file: No such file or directory at /usr/lib64/perl5/DynaLoader.pm line 200.\n at /var/www/cgi-bin/startup.pl line 17\nCompilation failed in require at /var/www/cgi-bin/startup.pl line 17.\nBEGIN failed--compilation aborted at /var/www/cgi-bin/startup.pl line 17.\nCompilation failed in require at (eval 2) line 1.\n
Startup.pl works when run from the command line, but fails to load through Apache
Things already tried
- Setting env variables in Apache conf (shown above)
- Checking file permisison for oracle libraries
- Printing env variables from command line and comparing with the output when running from Apache (after removing DBD::Oracle)
- Making sure all of Perl, Apache, Oracle, DBD:Oracle are for 64 bit
- Adding /home/oracle/app/oracle/product/11.2.0/client_1/lib to /etc/ld.so.conf and running ldconf