Apache RHEL Environment Setup Question (httpd-2.2.3-53.el5_7.1)

Tbone3434
Tbone3434 used Ask the Experts™
on
Hello,

I have some Perl scripts that use DBD::Oracle and run fine from command line however if I place them in the CGI-BIN directory and try to access them via the web I get the error below:

Can't load '/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/lib/perl5/x86_64-linux-thread-multi/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libocci.so.11.1: cannot open shared object file: No such file or directory at /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/DynaLoader.pm line 230.

I believe this is due to Apache environment not being setup correclty so my question is how do I setup the ENV in Apache like I do on a user .profile?

export ORACLE_HOME=/usr/lib/oracle/11.2/client64
export TNS_ADMIN=/usr/lib/oracle/11.2/client64/network/admin
export LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib
export PERL5LIB=/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/lib/perl5/x86_64-linux-thread-multi

Thanks!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
Was your ORACLE_HOME set before/when you compiled it?



Author

Commented:
Apache was installed long before Oracle was so no it was not.

Author

Commented:
I should also mention that I have the ENV declared in my script already.

$SETENV{ORACLE_HOME} = "/usr/lib/oracle/11.2/client64";
$SETENV{LD_LIBRARY_PATH}="/usr/lib/oracle/11.2/client64/lib";

use lib "/usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/lib/perl5/x86_64-linux-thread-multi";
use lib "/usr/lib/perl5/site_perl/5.8.8";
use lib "/usr/lib/oracle/11.2/client64/lib";
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Commented:
Try:

cd $ORACLE_HOME/lib
ln -s libocci.so.11.1 libocci.so


Also, what do you get when you run:

ls -l /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/lib/perl5/x86_64-linux-thread-multi/auto/DBD/Oracle/Oracle.so

and:

sed -n '230p' /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/DynaLoader.pm
Thanks for the assistance digus.  I ended up declaring them in httpd.conf.  Did an Apache restart and it worked.

Author

Commented:
I was able to figure out the issue

Commented:
Can you post the actual apache declaration statements then? Otherwise, the question is not technically "solved", as far as the EE community is concerned.

Thanks!

Author

Commented:
This is exactly what I added to  httpd.conf to resolve the issue.

# Environment variables
SetEnv ORACLE_HOME /usr/lib/oracle/11.2/client64
SetEnv LD_LIBRARY_PATH /usr/lib/oracle/11.2/client64/lib

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial