1) here is the output of the perl -V command:
************************************************************************************************
Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
Platform:
osname=linux, osvers=2.4.18-17.7.x, archname=i686-linux
uname='linux develop 2.4.18-17.7.x #1 tue oct 8 11:49:30 edt 2002 i686 unknown '
config_args=''
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc', ccflags ='-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
optimize='-O2',
cppflags='-fno-strict-aliasing -I/usr/local/include -I/usr/include/gdbm'
ccversion='', gccversion='2.96 20000731 (Red Hat Linux 7.3 2.96-112)', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib /home/oracle/lib
libs=-lnsl -lndbm -lgdbm -ldl -lm -lc -lcrypt -lutil
perllibs=-lnsl -ldl -lm -lc -lcrypt -lutil
libc=/lib/libc-2.2.5.so, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version='2.2.5'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'
Characteristics of this binary (from libperl):
Compile-time options: USE_LARGE_FILES
Built under linux
Compiled at Nov 5 2002 17:24:24
@INC:
/usr/local/lib/perl5/5.8.0/i686-linux
/usr/local/lib/perl5/5.8.0
/usr/local/lib/perl5/site_perl/5.8.0/i686-linux
/usr/local/lib/perl5/site_perl/5.8.0
/usr/local/lib/perl5/site_perl
/home/oracle/lib
.
************************************************************************************************
2) here is my little perl script to test database connection
************************************************************************************************
#!/usr/local/bin/perl
BEGIN {
$ENV{'ORACLE_HOME'} = "/home/oracle";
$ENV{'ORACLE_SID'} = "beijing";
$ENV{'LD_LIBRARY_PATH'} = "/home/oracle/lib";
$ENV{'NLS_LANG'} = "AMERICAN_AMERICA.WE8ISO8859P1";
}
use strict;
use warnings;
use CGI qw(:all);
use DBI;
sub dbi_error
{
my $msg = shift;
print "<p>$msg\n</p><br>";
die $msg;
}
my $dbh = DBI->connect("dbi:Oracle:Beijing","oasis42","info02") || &dbi_error("$DBI::errstr");
print "Connected to Oracle\n";
my $sql="select count(*) FROM emp_pass where lower(priv) like \'%erp%\'and badge_no= 1016 and pass=\'armand\'";
print "SQL: $sql\n";
my $sth=$dbh->prepare($sql) || &dbi_error("$DBI::errstr");
$sth->execute() || &dbi_error("$DBI::errstr");
my $ok=$sth->fetchrow_array;
if ($ok)
{
print "Get the record\n";
}
$sth->finish();
$dbh->disconnect();
exit;
****************************************************************************************************
3) here is the output of the script when run as apache user
************************************************************************************************
install_driver(Oracle) failed: Can't load '/usr/local/lib/perl5/site_perl/5.8.0/i686-linux/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libclntsh.so.8.0: cannot open shared object file: No such file or directory at /usr/local/lib/perl5/5.8.0/i686-linux/DynaLoader.pm line 229.
at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where expected
at ./ora_check.pl line 18
************************************************************************************************
I am still able to run the script as root or oracle user but not in any other user and I need desesperatly help to solve this issue
Thank you
Armand Brisson
Jeff Urlwin wrote:
It seems to be you using two different versions of perl. It isI didn't see that issue, but read the FAQ. Hint: Environment
standard on a
huge of linux platforms. Try to change the usere probertys ( hm, somewhere
in the $HOME I think ). To find out the versions try a 'whereis perl'.
Take a look in the /etc/httpd/conf ( or where apache.conf /
httpd.conf is on
your system ) and teach it to use /usr/bin/perl and not perl_mod or else.
See the DBI FAQ at www.xmlproj.com/cgi/fom.cgi
Hope this helps.
Best regards,
Kris wolff
Www.intra-team.de
On 04.11.2002 8:25 Uhr, "Armand Brisson" <[EMAIL PROTECTED]>
wrote:
I am setting in place an Apache Web server and I want to get access to a'/usr/local/lib/perl5/site_perl/5.8.0/i686-linux/auto/DBD/Oracle/O
remote Oracle 8 database.
Here are the step I did
1) I set up Linux RedHat 7.3 (Kernel 2.4.18-3
2) I updated OS through RHN (Kernel 2.4.18-17.7.x)
3) I installed Oracle Client 8.1.5 for Linux in /home/oracle (user:
oracle, group: oracle)
4) I Installed Apache 2.0.43
5) I Installed Perl 5.8.0
6) I updated CPAN (v.1.63)
7) I installed DBI from cpan and run the test successfully
8) I Installed DBD::Oracle from cpan and run test successfully
9) I ran tests (DBI and DBD) successfully with perl command as root
10) I wrote down a little perl to connect Database, select a row and
print a field
11) I ran this perl as root [perl ora_check.pl] and everything run fine
12) I ran this perl as user apache (And I get this kind of messages)
install_driver(Oracle) failed: Can't load
racle.so'
for module DBD::Oracle: libclntsh.so.8.0: cannot open shared object
file: No such file or directory at
/usr/local/lib/perl5/5.8.0/i686-linux/DynaLoader.pm line 229.
at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where expected
at /var/www/cgi-bin/ora_check.pl line 13
13) Did i missed something????? why does it work when run as root and
not as Apache ?
14) I have the same messages while running this perl script from APACHE
web server
15) Did i need to change some parameter for the compiler when I compile
perl 5.8.0?
