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

That's an expletive deleted, not a JAPH.

So... some part of the mod_perl installation process seems to have eluded me. This test.pl runs fine in mod_perl right now:

#!/usr/bin/perl use DBI; print "Content-type: text/html\n\n"; $d = DBI->connect("dbi:mysql:database=mysql", "root", ""); print "connected!!!!<br>" if $d;
However... if I reboot my machine, it fails with this error in my apache_error.log:

[Sun Aug 6 20:26:20 2000] [error] install_driver(mysql) failed: Can't + load '/usr/local/lib/perl5/site_perl/5.005/i386-freebsd/\ auto/DBD/mysql/mysql.so' for module DBD::mysql: Shared object "libmysq +lclient.so.6" not found at /usr/libdata/perl/5.00503/Dyna\ Loader.pm line 169. at (eval 41) line 3 at /usr/local/www/cgi-bin/test.pl line 7
The code snippet works from the command line just fine as well.

If, after rebooting the machine, I do an apachectl stop and an apachectl start, it works.

The problem is, DynaLoader.pm isn't set up with the correct @ld_library_path when apache is started at boot time; but starting and stopping from a shell gives it the correct path. Looking at the source for DynaLoader.pm, it seems to be getting its path from the environment variable LD_LIBRARY_PATH (primarily). However, that environment variable doesn't exist in the shell I restarted Apache from, so I'm wondering where Perl is getting it from....

So, my basic question is: What configuration did I screw up that would cause DynaLoader not to get the correct @ld_library_path when apache is started at boot time?

Specs: FreeBSD 3.4, everything was installed from standard ports and packages... Apache 1.3.9; mod_perl 1.20; perl 5.005_03.

Anyone?

Thanks!

Alan

Replies are listed 'Best First'.
Re: !@*$%& mod_perl
by lindex (Friar) on Aug 07, 2000 at 08:23 UTC
    It has something todo with the verion of gcc your perl install is
    compiled against as well as your version of mysql and libmysqlclient
    the best way to solve to problem is to recomile mysql,perl & DBI,DBD::mysql



    lindex
    /****************************/ jason@gost.net, wh@ckz.org http://jason.gost.net /*****************************/
Re: !@*$%& mod_perl
by ferrency (Deacon) on Aug 07, 2000 at 17:57 UTC
    Hrm, grumble. I really don't want to have to recompile all of those things.

    Where does Perl get its environment variables from, other than from the environment variables in the shell that ran perl? I'm not sure this makes sense as a compilation misconfiguration, since it Does work sometimes. But I may only think this because I don't really know what's going on...

    Alan