Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DBD

Status
Not open for further replies.

butterfly06

Programmer
Jun 7, 2006
7
US
Hi,

I can run a perl program on linux that needs a DBI connection using command line.
when I run the same program using webserver apche, I got the following error message:

install_driver(Oracle) failed: Can't load '/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/auto/DBD/Oracle/Oracle.so' for module DBD::Oracle: libclntsh.so.10.1: cannot open shared object file: No such file or directory at /usr/lib/perl5/5.8.0/i386-linux-thread-multi/DynaLoader.pm

Could someone please help me with that.
Thanks
 
When your program is called by Apache it is run as a different user than you. It may well be a user called Apache.
If you check your "env" you'll probably find some ORACLE or ORA environment variables that will be missing from the Apache user.
I'm not sure if setting them directly in your script via the %ENV hash would work or not but you could try it.



Trojan.
 
Can you please tell me how to set up oracle environment variables in order to run a script that needs a database connection on Apache?

Thanks
 
I thought I did.
Let's try to make it more obvious:
1) Login as the user that can run this script with no problems.
2) Type "env | fgrep ORA" (without the quotes and press enter).
3) In your perl script create the variables using the %ENV hash before you try any connections to the DB.
For example:
$ENV{'ORACLE_SID'} = "blahblahblah";
No guarantees that it'll work, it is only a suggestion but it may do.


Trojan.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top