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 AAFA6102C1 for ; Mon, 21 Oct 2013 20:12:40 +0000 (UTC) Received: (qmail 87323 invoked by uid 500); 21 Oct 2013 20:12:37 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 85167 invoked by uid 500); 21 Oct 2013 20:12:33 -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 84961 invoked by uid 99); 21 Oct 2013 20:12:23 -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 20:12:23 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of SmithCW@ldschurch.org designates 216.49.179.92 as permitted sender) Received: from [216.49.179.92] (HELO mail2.gmhwh.org) (216.49.179.92) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Oct 2013 20:12:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ldschurch.org; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=nov2012; bh=3ib6wqtxodq69pFi+yHvPF+DN5ybs4FfB0B9zxf2Z28=; b=81iLoP10/Dh5sDPSVZ2Tdwk2Mg1NvupjgcpNBf/uTZag/U71myQSEfqv4INkrSo4bYyt V56ank1tv7HK+HMP9CGP3J1Pgz8lI7wVMsMt3Wn3kfQOKW/BXvE59sVenagqqsiPiLkx X+Ql8X1XoZSyejgn2jNWcGbxNnzlnq/67mAfDLzLxTzEP9U5akHo0SfPIfBzWGRjoRWI TAgTG3Uph3H1eCvPSRMkUj+9PlkbCDxAgnMOV5XGqOIz9AFM0+a/RoHOQemg6C854pqG vBm25eS687h1fCfF0RQFTdGnWEmjbhqXvZ/aOhdAPOLMBnpFvGnEAxRRbxWdYt3mBT+7 kA== Received: from W12116.ldschurch.org (W12116.ldschurch.org [10.97.40.116]) by mail2.gmhwh.org (8.14.5/8.14.5) with ESMTP id r9LKBtQV008955 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Mon, 21 Oct 2013 14:11:56 -0600 Received: from chqpvuw1168.ldschurch.org (10.97.70.88) by W12116.ldschurch.org (10.97.40.116) with Microsoft SMTP Server (TLS) id 14.3.146.0; Mon, 21 Oct 2013 14:11:54 -0600 Received: from W12112.ldschurch.org ([169.254.13.20]) by CHQPVUW1168.ldschurch.org ([fe80::f9bb:cff4:5094:9a6%15]) with mapi id 14.03.0146.000; Mon, 21 Oct 2013 14:11:54 -0600 From: Charlie Smith To: Bruce Johnson , Fred Moyer CC: mod_perl list Subject: RE: Problem with mod_perl and DBI/DBD::Oracle LD_LIBRARY_PATH is not being recognized? Thread-Topic: Problem with mod_perl and DBI/DBD::Oracle LD_LIBRARY_PATH is not being recognized? Thread-Index: AQHOzob9STl8WvFKM02Mvd6xoHKxVJn/2+QAgAAE7oCAAAFmgIAAEYoA//+eiJA= Date: Mon, 21 Oct 2013 20:11:54 +0000 Message-ID: <63641EA705A403418BF1F5C9E726CB9537E7FB5A@W12112.ldschurch.org> References: <488A1B02-DF74-419A-B625-CBF407C2ACB5@pharmacy.arizona.edu> <76E621CC-01D9-4006-AEAA-C0B6D5520217@pharmacy.arizona.edu> <3FAB7F1A-A81B-4D8D-BA2A-850CC9C04807@pharmacy.arizona.edu> In-Reply-To: <3FAB7F1A-A81B-4D8D-BA2A-850CC9C04807@pharmacy.arizona.edu> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.97.250.5] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Disclaimer: True X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.10.8794,1.0.431,0.0.0000 definitions=2013-10-21_03:2013-10-21,2013-10-21,1970-01-01 signatures=0 X-Virus-Checked: Checked by ClamAV on apache.org Try setting perl env inside apache config. Example: SetEnv PERL5LIB "/usr/lib/5.10.0: /usr/lib/additionalPerlInstallArea" You also should have=20 LoadModule perl_module modules/mod_perl.so grep for mod_perl in the Apache error_log file? you'll see line indicating= that mod_perl resuming normal operations. Try also PerlResponseHandler ModPerl::RegistryPrefork Could also try putting in a ScriptAlias directive in httpd.conf for where y= ou perl scripts are. Make sure your perl dir is correct. There may be some aliases etc. needed = from /usr/lib/localperl to /usr/lib/perl for example. 64 bit perl? -----Original Message----- From: Bruce Johnson [mailto:johnson@Pharmacy.Arizona.EDU]=20 Sent: Monday, October 21, 2013 1:46 PM To: Fred Moyer Cc: mod_perl list Subject: Re: Problem with mod_perl and DBI/DBD::Oracle LD_LIBRARY_PATH is n= ot being recognized? Right where it's supposed to: /usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.so Again, if this was missing or the build was broken, it wouldn't work on the= command line or as a CGI script, either. This is what's making me go mad...I can't find anything wrong. %ENV is right %INC is right httpd.conf and perl.conf are right, as far as I can tell I've found one reference to this online that isn't very encouraging: "Never got to the bottom of this problem. Built different version of Apache= and ModPerl and tried various combinations of Oracle client until the prob= lem went away. Working combination: Apache/2.2.24 (Unix) mod_perl/2.0.7 Per= l/v5.10.1" Our sysadmin would rather we kept to the CentOS repos for all this to make = life easier for managing updates (this is a vm) On Oct 21, 2013, at 11:42 AM, Fred Moyer wrote: > Where does Oracle.so live on your filesystem? >=20 >=20 > On Mon, Oct 21, 2013 at 11:37 AM, Bruce Johnson wrote: >=20 > On Oct 21, 2013, at 11:20 AM, Fred Moyer wrote: >=20 > > This is annoying but it happens on 64 bit architectures. > > > > > The path is correct, the script works fine on the command line, and i= f I comment out the handler directives in the perl.conf script, put in a Sc= riptAlias and process the script as a normal CGI script, it also works. > > > > Sounds like some environment variable is not getting passed correctly t= o mod_perl. Maybe dump out %ENV from the command line and see if there are = additional vars you need to pass? >=20 > Nope, good idea but the vars I need are present, even with the modperl=20 > handler in place. The only ones you need for DBD::Oracle to work are=20 > ORACLE_HOME and LD_LIBRARY_PATH >=20 > DBD::Oracle was properly compiled, else it wouldn't work on the command l= ine, either. >=20 > > > > 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::Orac= le in /usr/lib instead of /usr/local/lib also - my guess is that it's looki= ng for the Oracle.so in /usr/local/lib but it is located somewhere else. >=20 > With mod_perl there is just one more, /etc/httpd >=20 > command line: >=20 > INC-> /usr/local/lib64/perl5 > INC-> /usr/local/share/perl5 > INC-> /usr/lib64/perl5/vendor_perl > INC-> /usr/share/perl5/vendor_perl > INC-> /usr/lib64/perl5 > INC-> /usr/share/perl5 > INC-> . >=20 > server: >=20 > INC-> /usr/local/lib64/perl5 > INC-> /usr/local/share/perl5 > INC-> /usr/lib64/perl5/vendor_perl > INC-> /usr/share/perl5/vendor_perl > INC-> /usr/lib64/perl5 > INC-> /usr/share/perl5 > INC-> . > INC-> /etc/httpd >=20 >=20 > > > > > > On Mon, Oct 21, 2013 at 10:57 AM, Bruce Johnson wrote: > > We've set a Directory directive for some perl scripts, setting a mod_pe= rl 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=20=20 > > > > > > The %ENV variable is there, if I print the %ENV values: > > > > LD_LIBRARY_PATH --> /usr/lib/oracle/11.2/client64/lib MOD_PERL -->=20 > > mod_perl/2.0.4 MOD_PERL_API_VERSION --> 2 ORACLE_HOME -->=20 > > /usr/lib/oracle/11.2/client64 PATH --> /sbin:/usr/sbin:/bin:/usr/bin > > > > But trying to initialize a DBI database connection results in the follo= wing error: > > > > [Mon Oct 21 10:10:37 2013] [error] install_driver(Oracle) failed:=20 > > Can't load '/usr/local/lib64/perl5/auto/DBD/Oracle/Oracle.so' for=20 > > module DBD::Oracle: libocci.so.11.1: cannot open shared object file:=20 > > No such file or directory at /usr/lib64/perl5/DynaLoader.pm line=20 > > 200.\n at (eval 11) line 3\nCompilation failed in require at (eval=20 > > 11) line 3.\nPerhaps a required shared library or dll isn't=20 > > installed where expected\n at=20 > > /home/allwebfiles/perl/catcard/oratest.pl line 9\n > > > > Which is precisely the error you get when LD_LIBRARY_PATH is unset or i= ncorrect. > > > > libocci.so.11.1 is where it's supposed to be. > > > > [root@merthiolate catcard]# ls -l /usr/lib/oracle/11.2/client64/lib=20 > > 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 Scri= ptAlias 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::Or= acle. > > > > 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,=20 > > {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=20 > > error.) > > > > What am I missing? > > > > -- > > Bruce Johnson > > University of Arizona > > College of Pharmacy > > Information Technology Group > > > > Institutions do not have opinions, merely customs > > > > > > >=20 > -- > Bruce Johnson > University of Arizona > College of Pharmacy > Information Technology Group >=20 > Institutions do not have opinions, merely customs >=20 >=20 >=20 -- Bruce Johnson University of Arizona College of Pharmacy Information Technology Group Institutions do not have opinions, merely customs NOTICE: This email message is for the sole use of the intended recipient(s= ) and may contain confidential and privileged information. Any unauthorized= review, use, disclosure or distribution is prohibited. If you are not the = intended recipient, please contact the sender by reply email and destroy al= l copies of the original message.