Regarding the environment variables. That was an issue, but not THE issue. I had to add my environment variables to /etc/httpd/conf.d/env.conf and restart httpd for apache to see them. I'm not sure how else I could update the environment variables for the apache user.
Apache has PassEnv, SetEnv, and UnsetEnv in mod_env.
One thing I can't seem to do is add the /usr/local/instantclient directory to the path, since the env.conf file doesn't support expanding $PATH.
I don't think you need to do that. You basically need some DLLs from the instant client, that are referenced in the XS part of DBD::Oracle. So that's more a LD_LIBRARY_PATH problem and less a PATH problem. Installing instant client should already have taken care of that problem.
There is an old trick that will probably still work. The environent variables for Oracle don't have to be set when the perl executable starts. It runs fine without them. The variables need to be set before perl loads DBD/Oracle.so and the DLLs from the Oracle client. So, you can set up the environment variables from within perl. That just has to happen before DBD::Oracle is loaded. The DBI module may already load DBD::Oracle way before you try to connect to Oracle, so it has to happen before loading DBI. Or, in a few lines of code:
#!/usr/bin/perl use strict; use warnings; BEGIN { # This BEGIN block must come before "use DBI" and before "use DBD: +:Oracle", or this trick won't work! $ENV{'WHATEVER_ORACLE_WANTS'}='is set here'; $ENV{'MAYBE_EVEN_SEVERAL'}='environment variables'; } use DBI qw( ... ); # maybe hidden in your database handling module
If you don't run a CGI or FastCGI script, but use mod_perl, you probably need to put the BEGIN block into a startup file (see PerlRequire for the ancient mod_perl 1.0, PerlConfigRequire and PerlPostConfigRequire for mod_perl 2.0).
Alexander
In reply to Re^3: Can't locate loadable object for module DBD::Oracle in @INC
by afoken
in thread Can't locate loadable object for module DBD::Oracle in @INC
by Calab
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |