Return-Path: X-Original-To: apmail-perl-modperl-archive@www.apache.org Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A5F1B10CA0 for ; Mon, 21 Oct 2013 18:20:40 +0000 (UTC) Received: (qmail 28900 invoked by uid 500); 21 Oct 2013 18:20:39 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 28873 invoked by uid 500); 21 Oct 2013 18:20:38 -0000 Mailing-List: contact modperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list modperl@perl.apache.org Received: (qmail 28866 invoked by uid 99); 21 Oct 2013 18:20:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Oct 2013 18:20:38 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [209.85.128.48] (HELO mail-qe0-f48.google.com) (209.85.128.48) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Oct 2013 18:20:33 +0000 Received: by mail-qe0-f48.google.com with SMTP id d4so3989566qej.21 for ; Mon, 21 Oct 2013 11:20:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=qDlk66oMIL0GPQ2FpEQCEOSJePTEAkDrWxF6DpJT0fk=; b=hAYXiKGOr7IQ2dE6AYZX+H9UgQSY4d7oSje9AX0HdndFxPIF6dsmulYwGVpSolsONA DV6CoS83oyv3zqweolwuE6YBMmB8AjRPFr2u1XzkUgNK+JCVo0XQiBrRQMgbpXC/95Ys MLFY7leWJLgNDriu2U4TFcS73FmF6GkTfoHrEcTi3rKOmjcO/BGAuUQFEf2DlCdBATMd qDnptRX8bHXN1rwdK3ZdcW7ze9/kO7BxBaN2pyNpWyoPtmBI1q5NL9PPQmFWlPv6xFZC TWSo4TSFk4ZPGSpfGPb/uF2bWGvO41xVMTe7rxZFeT9AIYlpvrBNDX6yB8Bpk4Q0h2UM qPFg== X-Gm-Message-State: ALoCoQl4AabsQcCp/ns1vNpoh8qPPTKcVTaIwEGW2z8afn++c42BVrOlo60++U/77WRTeLcAhwre MIME-Version: 1.0 X-Received: by 10.229.201.67 with SMTP id ez3mr24236503qcb.1.1382379612368; Mon, 21 Oct 2013 11:20:12 -0700 (PDT) Received: by 10.224.89.72 with HTTP; Mon, 21 Oct 2013 11:20:12 -0700 (PDT) In-Reply-To: <488A1B02-DF74-419A-B625-CBF407C2ACB5@pharmacy.arizona.edu> References: <488A1B02-DF74-419A-B625-CBF407C2ACB5@pharmacy.arizona.edu> Date: Mon, 21 Oct 2013 11:20:12 -0700 Message-ID: Subject: Re: Problem with mod_perl and DBI/DBD::Oracle LD_LIBRARY_PATH is not being recognized? From: Fred Moyer To: Bruce Johnson Cc: mod_perl list Content-Type: multipart/alternative; boundary=001a11c35ec4bd8b2d04e94455fe X-Virus-Checked: Checked by ClamAV on apache.org --001a11c35ec4bd8b2d04e94455fe Content-Type: text/plain; charset=ISO-8859-1 This is annoying but it happens on 64 bit architectures. > The path is correct, the script works fine on the command line, and if I comment out the handler directives in the perl.conf script, put in a ScriptAlias and process the script as a normal CGI script, it also works. Sounds like some environment variable is not getting passed correctly to mod_perl. Maybe dump out %ENV from the command line and see if there are additional vars you need to pass? I'd dump out %INC from the command line and mod_perl also to make sure that you are loading the needed modules. You could try to install DBD::Oracle in /usr/lib instead of /usr/local/lib also - my guess is that it's looking for the Oracle.so in /usr/local/lib but it is located somewhere else. On Mon, Oct 21, 2013 at 10:57 AM, Bruce Johnson < johnson@pharmacy.arizona.edu> wrote: > We've set a Directory directive for some perl scripts, setting a mod_perl > handler: > > Alias /card_access /home/allwebfiles/perl/catcard > > > SetHandler perl-script > PerlResponseHandler ModPerl::Registry > PerlOptions +ParseHeaders > Options +ExecCGI > PerlSetEnv LD_LIBRARY_PATH /usr/lib/oracle/11.2/client64/lib > PerlSetEnv ORACLE_HOME /usr/lib/oracle/11.2/client64 > > > The %ENV variable is there, if I print the %ENV values: > > LD_LIBRARY_PATH --> /usr/lib/oracle/11.2/client64/lib > MOD_PERL --> mod_perl/2.0.4 > MOD_PERL_API_VERSION --> 2 > ORACLE_HOME --> /usr/lib/oracle/11.2/client64 > PATH --> /sbin:/usr/sbin:/bin:/usr/bin > > But trying to initialize a DBI database connection results in the > following error: > > [Mon Oct 21 10:10:37 2013] [error] install_driver(Oracle) failed: Can't > load '/usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.so' for module > DBD::Oracle: libocci.so.11.1: cannot open shared object file: No such file > or directory at /usr/lib64/perl5/DynaLoader.pm line 200.\n at (eval 11) > line 3\nCompilation failed in require at (eval 11) line 3.\nPerhaps a > required shared library or dll isn't installed where expected\n at > /home/allwebfiles/perl/catcard/oratest.pl line 9\n > > Which is precisely the error you get when LD_LIBRARY_PATH is unset or > incorrect. > > libocci.so.11.1 is where it's supposed to be. > > [root@merthiolate catcard]# ls -l /usr/lib/oracle/11.2/client64/lib > total 185016 > -rw-r--r-- 1 root root 368 Sep 17 2011 glogin.sql > lrwxrwxrwx 1 root root 17 May 20 12:07 libclntsh.so -> > libclntsh.so.11.1 > -rw-r--r-- 1 root root 52761218 Sep 17 2011 libclntsh.so.11.1 > -rw-r--r-- 1 root root 7955322 Sep 17 2011 libnnz11.so > lrwxrwxrwx 1 root root 15 May 20 12:07 libocci.so -> libocci.so.11.1 > -rw-r--r-- 1 root root 1971762 Sep 17 2011 libocci.so.11.1 > -rw-r--r-- 1 root root 118408281 Sep 17 2011 libociei.so > -rw-r--r-- 1 root root 164836 Sep 17 2011 libocijdbc11.so > -rw-r--r-- 1 root root 1503303 Sep 17 2011 libsqlplusic.so > -rw-r--r-- 1 root root 1477446 Sep 17 2011 libsqlplus.so > -rw-r--r-- 1 root root 2095661 Sep 17 2011 ojdbc5.jar > -rw-r--r-- 1 root root 2714016 Sep 17 2011 ojdbc6.jar > -rw-r--r-- 1 root root 300666 Sep 17 2011 ottclasses.zip > -rw-r--r-- 1 root root 66779 Sep 17 2011 xstreams.jar > > The path is correct, the script works fine on the command line, and if I > comment out the handler directives in the perl.conf script, put in a > ScriptAlias and process the script as a normal CGI script, it also works. > > I'm confident the issue doesn't have anything to do with DBI or > DBD::Oracle. > > It ONLY fails when the script is executed as a mod_perl handler. > > The script itself is very simple; all I do is create a database handle and > if no error is thrown, print 'It works'. > > #!/usr/bin/perl > use DBI; > use strict; > > my $login="xxxxxx"; > my $dbpass='xxxxxxxx'; > my $dbname="host=xxx.xxx.xxx.xx;sid=xxx"; > my $dbh = DBI->connect("dbi:Oracle:$dbname", $login, $dbpass, {RaiseError > =>1}); > > print "Content-type: text/html\n\n"; > print "It Works"; > exit; > > (and this is just a test , any script using DBI fails with this error.) > > What am I missing? > > -- > Bruce Johnson > University of Arizona > College of Pharmacy > Information Technology Group > > Institutions do not have opinions, merely customs > > > --001a11c35ec4bd8b2d04e94455fe Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
This is annoying but it happens on 64 bit architectures.
>=A0The path is correct, the script works fine on the command line, a= nd if I comment out the handler directives in the perl.conf script, put in = a ScriptAlias and process the script as a normal CGI script, it also works.=

Sou= nds like some environment variable is not getting passed correctly to mod_p= erl. Maybe dump out %ENV from the command line and see if there are additio= nal vars you need to pass?

I'd dump out %INC from the= command line and mod_perl also to make sure that you are loading the neede= d modules. You could try to install DBD::Oracle in /usr/lib instead of /usr= /local/lib also - my guess is that it's looking for the=A0Oracle.so=A0in /usr/local/lib but it is loca= ted somewhere else.


On Mon,= Oct 21, 2013 at 10:57 AM, Bruce Johnson <johnson@pharmacy.ariz= ona.edu> wrote:
We've set a Directory directive for some= perl scripts, setting a mod_perl handler:

Alias /card_access /home/allwebfiles/perl/catcard

=A0<Directory /home/allwebfiles/perl/catcard>
=A0 =A0 =A0SetHandler perl-script
=A0 =A0 =A0PerlResponseHandler ModPerl::Registry
=A0 =A0 =A0PerlOptions +ParseHeaders
=A0 =A0 =A0Options +ExecCGI
=A0 =A0 =A0PerlSetEnv LD_LIBRARY_PATH /usr/lib/oracle/11.2/client64/lib
=A0 =A0 =A0PerlSetEnv ORACLE_HOME /usr/lib/oracle/11.2/client64
=A0</Directory>

The %ENV variable is there, if I print the %ENV values:

LD_LIBRARY_PATH --> /usr/lib/oracle/11.2/client64/lib
MOD_PERL --> mod_perl/2.0.4
MOD_PERL_API_VERSION --> 2
ORACLE_HOME --> /usr/lib/oracle/11.2/client64
PATH --> /sbin:/usr/sbin:/bin:/usr/bin

But trying to initialize a DBI database connection results in the following= error:

[Mon Oct 21 10:10:37 2013] [error] install_driver(Oracle) failed: Can't= load '/usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.so' for module= DBD::Oracle: libocci.so.11.1: cannot open shared object file: No such file= or directory at /usr/lib64/perl5/DynaLoader.pm line 200.\n at (eval 11) li= ne 3\nCompilation failed in require at (eval 11) line 3.\nPerhaps a require= d shared library or dll isn't installed where expected\n at /home/allwe= bfiles/perl/catcard/oratest= .pl line 9\n

Which is precisely the error you get when LD_LIBRARY_PATH is unset or incor= rect.

libocci.so.11.1 is where it's supposed to be.

[root@merthiolate catcard]# ls -l /usr/lib/oracle/11.2/client64/lib
total 185016
-rw-r--r-- 1 root root =A0 =A0 =A0 368 Sep 17 =A02011 glogin.sql
lrwxrwxrwx 1 root root =A0 =A0 =A0 =A017 May 20 12:07 libclntsh.so -> li= bclntsh.so.11.1
-rw-r--r-- 1 root root =A052761218 Sep 17 =A02011 libclntsh.so.11.1
-rw-r--r-- 1 root root =A0 7955322 Sep 17 =A02011 libnnz11.so
lrwxrwxrwx 1 root root =A0 =A0 =A0 =A015 May 20 12:07 libocci.so -> libo= cci.so.11.1
-rw-r--r-- 1 root root =A0 1971762 Sep 17 =A02011 libocci.so.11.1
-rw-r--r-- 1 root root 118408281 Sep 17 =A02011 libociei.so
-rw-r--r-- 1 root root =A0 =A0164836 Sep 17 =A02011 libocijdbc11.so
-rw-r--r-- 1 root root =A0 1503303 Sep 17 =A02011 libsqlplusic.so
-rw-r--r-- 1 root root =A0 1477446 Sep 17 =A02011 libsqlplus.so
-rw-r--r-- 1 root root =A0 2095661 Sep 17 =A02011 ojdbc5.jar
-rw-r--r-- 1 root root =A0 2714016 Sep 17 =A02011 ojdbc6.jar
-rw-r--r-- 1 root root =A0 =A0300666 Sep 17 =A02011 ottclasses.zip
-rw-r--r-- 1 root root =A0 =A0 66779 Sep 17 =A02011 xstreams.jar

The path is correct, the script works fine on the command line, and if I co= mment out the handler directives in the perl.conf script, put in a ScriptAl= ias and process the script as a normal CGI script, it also works.

I'm confident the issue doesn't have anything to do with DBI or DBD= ::Oracle.

It ONLY fails when the script is executed as a mod_perl handler.

The script itself is very simple; all I do is create a database handle and = if no error is thrown, print 'It works'.

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

my $login=3D"xxxxxx";
my $dbpass=3D'xxxxxxxx';
my $dbname=3D"host=3Dxxx.xxx.xxx.xx;sid=3Dxxx";
my $dbh =3D DBI->connect("dbi:Oracle:$dbname", $login, $dbpass= , {RaiseError =3D>1});

print "Content-type: text/html\n\n";
print "It Works";
exit;

(and this is just a test , any script using DBI fails with this error.)

What am I missing?

--
Bruce Johnson
University of Arizona
College of Pharmacy
Information Technology Group

Institutions do not have opinions, merely customs



--001a11c35ec4bd8b2d04e94455fe--