You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Artem Harutyunyan <ha...@gmail.com> on 2007/08/15 18:02:21 UTC

Problem with loading dynamic libraries

Hi,

I have 2 questions:

1) There is a script which uses Authen::SASL::Cyrus module. During the work
the module needs to load some external dynamic libraries (.so files). To
have correct libraries loaded I set LD_LIBRARY_PATH, this works when running
my script with usual (command line) perl. However, when I run the script
under apache (with mod_perl) I see that LD_LIBRARY_PATH is ignored (I mean
it seems to load the libraries from another location). How can I fix the
problem ?

2) I have several installations of perl. How can I find out (and change if
necessary) which one is used by mod_perl ?

Thanks in advance for help,
Artem.

PS The apache version is 2.0.55 and mod_perl is 2.0.1

Re: Problem with loading dynamic libraries

Posted by Artem Harutyunyan <ha...@gmail.com>.
Hi Michael,

Thank you very much for the exhaustive answer.

Artem.

On 8/15/07, Michael Peters <mp...@plusthree.com> wrote:
>
> Artem Harutyunyan wrote:
> > However,
> > when I run the script under apache (with mod_perl) I see that
> > LD_LIBRARY_PATH is ignored (I mean it seems to load the libraries from
> > another location). How can I fix the problem ?
>
> What OS are you running? I know at least for linux LD_LIBRARY_PATH is
> special
> (for security reasons). It can't be set from within the process that's
> going to
> need it. It must be set from outside.
>
> I've fixed this by setting it in my script that starts/stops apache.
>
> > 2) I have several installations of perl. How can I find out (and change
> > if necessary) which one is used by mod_perl ?
>
> mod_perl doesn't pick a perl binary to use. It is a Perl interpreter. And
> it's
> the same version that you compiled it against. The only way to change it's
> version is to recompile mod_perl using another perl binary.
>
> --
> Michael Peters
> Developer
> Plus Three, LP
>
>

Re: Problem with loading dynamic libraries

Posted by Michael Peters <mp...@plusthree.com>.
Artem Harutyunyan wrote:
> However,
> when I run the script under apache (with mod_perl) I see that
> LD_LIBRARY_PATH is ignored (I mean it seems to load the libraries from
> another location). How can I fix the problem ?

What OS are you running? I know at least for linux LD_LIBRARY_PATH is special
(for security reasons). It can't be set from within the process that's going to
need it. It must be set from outside.

I've fixed this by setting it in my script that starts/stops apache.

> 2) I have several installations of perl. How can I find out (and change
> if necessary) which one is used by mod_perl ?

mod_perl doesn't pick a perl binary to use. It is a Perl interpreter. And it's
the same version that you compiled it against. The only way to change it's
version is to recompile mod_perl using another perl binary.

-- 
Michael Peters
Developer
Plus Three, LP