Bob you are brilliant. Apache didn't have the environment but my user did. I
set the environmental variables in the script like you suggested and it
works great!
Thanks,
Brian
-Original Message-
From: Bob Showalter [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 19, 2005 1:45 PM
To: '[EMAIL PROTECTED]'
Cc: 'beginners@perl.org'
Subject: RE: Problems accessing oracle via cgi and apache
[EMAIL PROTECTED] wrote:
Hi all. I think I have some sort of permissions problem here i'm
hoping to get help for.
I'm running apache on HP-UX. I have a perl script that accesses a
database (local) and displays the results in a HTML table format.
Pretty simple. I've done lots of database scripting before so i
figured this should be nothing new. Well, when I run it from the
command line it runs fine, displaying the html output with the
database records like it should. HOWEVER, when i put said script in
my cgi-bin and access it with a web browser I get a database connect
error. Basically the DBI-connect() is failing.
What's the error?
Since it runs fine from the command line and fails when run through
apache i figure it's got to be some sort of permissions thing. Or
something else fairly simple (hopefully). What user does apache run
scripts as?
Any other ideas?
Set ORACLE_HOME (and possibly ORACLE_SID) in your script:
BEGIN {
$ENV{ORACLE_HOME} = '/path/to/oracle/home';
$ENV{ORACLE_SID} = 'mydb';
}
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response