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

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

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

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.