Re: Problem with mod_perl and DBI/DBD::Oracle LD_LIBRARY_PATH is not being recognized?

Bruce Johnson <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <[email protected]>
On Oct 22, 2013, at 8:23 AM, Torsten Förtsch <[email protected]> wrote:

> On 21/10/13 19:57, Bruce Johnson wrote:
>> We've set a Directory directive for some perl scripts, setting a mod_perl handler:
>> 
>> Alias /card_access /home/allwebfiles/perl/catcard
>> 
>> <Directory /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
>> </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) 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
>> 
> I haven't read the whole thread. So, I apologize if I state what
> somebody else has already explained.
> 
> To me the problem seems to be %ENV being tied to $r->subprocess_env. So,
> neither PerlSetEnv nor SetEnv actually change the current process'
> environment.

Pardon me if this sounds dumb, but what possible use are those directives, then? 

> The reason for that the environment is a global resource in
> a potentially multi-threaded process.
> 
> If you don't need these variables set differently for different requests
> you can perhaps set them before starting httpd. Or you can set them
> perhaps in a <perl> section or similar.
> 

That's one thing I don't think we've tried. What I still don't understand is how PerlSetEnv variables ARE present in the Apache process handled by that perl handler, but not in the perl handler code itself.

Even setting "%ENV{'LD_LIBRARY_PATH'}= <path to libs>;" in the perl handler code itself fails, and if the handler code cannot alter it's own process, then I'm stuck.

I'll try recompiling DBD::Oracle.

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

Institutions do not have opinions, merely customs
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.