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

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!
Tbone3434Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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



0
Tbone3434Author Commented:
Apache was installed long before Oracle was so no it was not.
0
Tbone3434Author 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";
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

digusCommented:
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
0
Tbone3434Author Commented:
Thanks for the assistance digus.  I ended up declaring them in httpd.conf.  Did an Apache restart and it worked.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Tbone3434Author Commented:
I was able to figure out the issue
0
digusCommented:
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!
0
Tbone3434Author 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
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.