jt_exist has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I have two Perl version/instance of Perl, now my cgi is dependent on a module(Net::LDAPS) that provided by Perl instance that's not the installed by default on the OS. I tried to add that Perl version on PER5LIB, as well as put on it script itself using BEGIN but still having the error, now I'm seeking for the wisdom of those who have trodden this path.

Built under solaris Compiled at May 21 2009 03:59:02 %ENV: PERL5LIB="/usr/local/lib/perl5/site_perl/5.8.6" @INC: /usr/local/lib/perl5/site_perl/5.8.6 /usr/perl5/5.8.4/lib/sun4-solaris-64int /usr/perl5/5.8.4/lib /usr/perl5/site_perl/5.8.4/sun4-solaris-64int /usr/perl5/site_perl/5.8.4 /usr/perl5/site_perl /usr/perl5/vendor_perl/5.8.4/sun4-solaris-64int /usr/perl5/vendor_perl/5.8.4 /usr/perl5/vendor_perl .
BEGIN { push @INC, "/usr/local/lib/perl5/site_perl/5.8.6"; } BEGIN { push @INC, "/usr/local/lib/perl5/site_perl/5.8.6/sun4-solaris- +thread-multi"; } use CGI qw(:standard); use Net::LDAPS;

here's the error: [Tue Mar 13 15:21:51 2012] [error] [client xxxx] ld.so.1: perl: fatal: + relocation error: file /usr/local/lib/perl5/site_perl/5.8.6/sun4-sol +aris-thread-multi/auto/Net/SSLeay/SSLeay.so: symbol Perl_Gthr_key_ptr +: referenced symbol not found,

This is now solved, as suggested on serverfault I need to replace the perl binary hash bang #!/path_of_desired/perl line to the script.

Replies are listed 'Best First'.
Re: Apache + CGI with 2 Perl instance
by flexvault (Monsignor) on Mar 15, 2012 at 08:33 UTC

    jt_exist,

    This is more of a guess about what could be going wrong. Apache may actually be ignoring your request to change @INC. With Apache 1.3.xx, I could do a lot more with Perl cgi then I can do with 2.x.x. Sadly, my experience is that Apache doesn't log the "skip", it just ignores it.

    Because of this, I use a persistent Perl script running that talks to the cgi script over sockets. It is painful, but eliminates what Apache with or without mod-perl will do/not do. It's tough enough debugging a cgi script, without having code simply being ignored

    Maybe someone will have a better answer.

    UPDATE:I started my answer before your update, and I'm glad you solved your problem.

    Good Luck.

    "Well done is better than well said." - Benjamin Franklin