Hello All,

I have a similar issue with some Perl scripts that are invoked by QMail -
the scripts process email on a command-response type system, interacting
with an Oracle database.

Or at least - that's the idea :) Qmail sets its own Enviroment variables to
scripts it calls (i'm using a pipe from .qmail) ... which don't include the
Oracle variables.

The error I'm seeing is:

install_driver(Oracle) failed: Can't load
'/usr/local/lib/perl5/site_perl/5.6.0/i686-linux/auto/DBD/Oracle/Oracle.so'
for module DBD::Oracle: libclntsh.so.1.0: cannot open shared object file: No
such file or directory at
/usr/local/lib/perl5/5.6.0/i686-linux/DynaLoader.pm line 200.
 at (eval 1) line 3
Compilation failed in require at (eval 1) line 3.
Perhaps a required shared library or dll isn't installed where expected
 at /home/smsin/mail2db.orcl line 49


... I previously ran into this exact same error when using Apache, and I
fixed it by adding the following to my apache.conf:

SetEnv ORACLE_BASE /usr/local/oracle/app/oracle
SetEnv ORACLE_HOME /usr/local/oracle/app/oracle/product/8.0.5
SetEnv ORACLE_SID orcl
SetEnv ORACLE_TERM 386
SetEnv LD_LIBRARY_PATH /usr/local/oracle/app/oracle/product/8.0.5/lib

... this might be the solution that Charley is looking for. However it
doesn't help me with my mail, cauz I don't think you can ask QMail to set
environment variables for you.

I've tried setting the environment in the script, like this:

BEGIN {
  $ENV{ORACLE_BASE} = '/usr/local/oracle/app/oracle';
  $ENV{ORACLE_HOME} = '/usr/local/oracle/app/oracle/product/8.0.5';
  $ENV{ORACLE_SID} = 'orcl';
  $ENV{ORACLE_TERM} = '386';
  $ENV{LD_LIBRARY_PATH} = '/usr/local/oracle/app/oracle/product/8.0.5/lib';
  $ENV{OSTYPE} = 'Linux';
}

(I enclosed the statements in a BEGIN block after seeing Anthony Bouvier's
suggestion... but it doesn't seem to have helped).

I'm outputting %ENV to STDERR to check it, and everything appears to be set.
I've also added a section into Dynaloader.pm to dump the environment it sees
into a logfile, and again that seems to be fine.

I'm using DBD-Oracle 1.06 and DBI 1.14 with Oracle 8.0.5 on RedHat 6.1.

If anyone could offer any suggestions or help it would be greatly
appreciated.


TIA-

Daniel.


----- Original Message -----
From: "MPM" <[EMAIL PROTECTED]>
To: "Sterin, Ilya" <[EMAIL PROTECTED]>
Cc: "Charley Wu" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, April 03, 2001 1:50 PM
Subject: RE: ORACLE_HOME environment variable not set


> Actually, I'd question this.  I get the same error(though i can still
> connect).  I've even put debuging code into the script that we use to
> start apache and it shows that $ORACLE_HOME is properly set when the
> script is run.
> Just for reference Versions:
> Perl 5.6.0
> DBI 1.14
> DBD::ORACLE 1.06
>
> I haven't felt like chasing down when/where the error is coming from.  It
> works for now and one error on start up is minor compared to spending the
> errors that occure inside the code running the website.
>
> Scott
>
>
> On Mon, 2 Apr 2001, Sterin, Ilya wrote:
>
> > The browser connects with a user nobody or www or other, since when you
> > installed Oracle the ORACLE_HOME was not set for this user, you can
either
> > set it in the environment or explicitely in you script.  A sample script
> > would also help.
> >
> > Ilya Sterin
> >
> > -----Original Message-----
> > From: Charley Wu [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, April 02, 2001 5:04 PM
> > To: [EMAIL PROTECTED]
> > Subject: ORACLE_HOME environment variable not set
> >
> >
> > Hello,
> >
> > I installed Perl DBI and Oracle DBD locally under my own unix directory.
I
> > wrote a test a script to retrieve data from  an Oracle database. The
script
> > worked perfectly under command line and I got the right data from the
> > database. However, when I tried to execute the script from a web page as
a
> > cgi script, I get the following error: "ORACLE_HOME environment variable
not
> > set". The script would not work even I set the ORACLE_HOME environment
> > variable explicitly in the script. How to solve the problem? Do I need
to
> > modify the web server configuration file?  Thanks in advance for your
help.
> >
> > Charley
> >


Reply via email to