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

I have a program using DBD::Oracle in perl. Runs fine at command line, can't get it to run in httpd as root, but not for any other user.

I've set all the paths in /etc/profile, /etc/ld.so.conf.d/oracle.conf and within the program itself.

I've disabled selunix. I've confirmed file permissions to the oracle library.

I've even set apache so I could su to it from root and made sure I can get to all of the libraries and directories I could possibly need.

Apache just will not run it, or any regular user, but root works fine.

I tried as my regular use account..no go on that either.

I get the following error that is driving me nuts!

install_driver(Oracle) failed: Can't locate DBD/Oracle.pm in @INC (@INC contains: /usr/local/lib/perl5 /usr/local/share/perl5 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5 /usr/share/perl5 .) at (eval 3) line 3. Perhaps the DBD::Oracle perl module hasn't been fully installed, or perhaps the capitalisation of 'Oracle' isn't right. Available drivers: DBM, ExampleP, File, Gofer, Pg, Proxy, SQLite, Sponge, mysql.

Replies are listed 'Best First'.
Re: DBD::Oracle in browser
by gsiems (Deacon) on Jan 06, 2016 at 21:22 UTC
    For the user for whom the program works, what does the output of:
    perl -e 'print join "\n", @INC'
    look like?
Re: DBD::Oracle in browser
by sgrennay (Initiate) on Jan 06, 2016 at 21:17 UTC

    I opened up permissions on /usr/local/lib/perl5 and low and behold I have a new error that night give a hint.

    DBI object version 1.609 does not match bootstrap parameter 1.634 at /usr/lib/perl5/DynaLoader.pm line 223.

    BEGIN failed--compilation aborted at /usr/local/lib/perl5/DBI.pm line 286.

    I have perl-DBI-1.609-4.el6.i686 installed and I also fetched DBI from cpan which looks like version 1.634.

    Anyone have an idea how to solve this? This is a server that just went into production this week and I only have a handful of little programs that need this. We are in the process of migrating off of oracle, but it will be a few more months until we are done.

      You have more than one version of DBI installed on the machine and the perl you are running finds the wrong version first.

      Check the contents of @INC and adjust them before running your program, most easily through PERL5LIB (via perlrun).

      Hello sgrennay- Did you fix this problem as I am also facing the same problem, but couldn't able to fix it, any help will be appreciated.