However, once I put the script in the cgi-bin and try to
run it from a browser, I get not output ( can't remember
the exact message, sorry ).
I dug around a little more and found that I need to add
something like :
print "Content-type: text/plain\n\n" ;
So I added that code ... but still no output to a browser.
I wrote a small Perl script, a "hello world" type, and added the
above line and the script output to a browser, no problem.
It seems to be when I try to connect to an Oracle database
that I have the problem. So I ran the script at the command
line as root and found that it did not run correctly until I defined
ORACLE_HOME.
So this leads me to suspect that Apache needs to know about
ORACLE_HOME in order for my Perl script that accesses an Oracle
database to work in a browser.
So the question is where do I define ORACLE_HOME and how. Is
it something like "SetEnv ORACLE_HOME /oracle/product/8.1.7"
added in httpd.conf?
I think that I can do a similar thing in my Perl script directly ( I'm pretty new
to Perl but do recall that I can set an environment variable in Perl ) but I don't
want to have to do that to every Perl script, a more global solution is
preferable and much more elegant.
Any suggestions? Thanks in advance.
===
Yurasis Dragon
sp...@smeagol.com
Yurasis Dragon <sp...@smeagol.com> wrote in message
news:nfmg0ucbve6sccavr...@4ax.com...
Note how all the help came from the "wrong" group. Looks like
I made the correct choice for the very reason that I posted in the
comp.databases.oracle.tools group. Oracle people who work with
a webserver would have the answer I'm looking for.
Thanks again.
Yurasis Dragon <sp...@smeagol.com> :
===
Yurasis Dragon
sp...@smeagol.com
Yurasis Dragon <sp...@smeagol.com> wrote in message
news:hrml0usvvfm76va51...@4ax.com...
Anyway...oracletool.com has an open source Perl/Oracle
project...I guess Perl junkies can learn a lot.
Robert Chin
BTW, I have a special e-mail address that I use, sp...@smeagol.com,
that I use whenever I have to give up an e-mail address at
a web-site, etc. - this way non-important e-mail doesn't get mixed
with "important" e-mail. Then I check sp...@smeagol.com whenever
I expect e-mail that I may need to read ... it works for me.
Shrieking in pain from a horribly disfigured body, "Robert Chin" <robert_c...@hotmail.com> groaned :
===
Yurasis Dragon
sp...@smeagol.com
BEGIN {
$ENV{ORACLE_BASE}='/u01/app/oracle'; # replace with $ORACLE_BASE
$ENV{ORACLE_SID}='sid'; # replace with your default SID
$ENV{ORACLE_OWNER}='oracle'; # replace with your $ORACLE_OWNER
$ENV{ORA_LOG}='/home/oracle/log'; # replace with your log path
$ENV{ORACLE_HOME}='/u01/app/oracle/product/8.0.5'; # replace with your
$ORACLE_HOME
$ENV{ORA_UTIL}='/home/oracle/util';} # replace with your oracle util
directory
--
Dodger
Close. The ORACLE_HOME environment variable needs to be set when the
database driver for Oracle is loaded. There's two ways to do this:
either have it set in the envrionment which starts up the perl program,
or set it within the perl program sometime before you load the database
driver. If your program is running as a CGI, then to have that variable
set in the environment before perl starts, it would have to be done via
the web server.
> So the question is where do I define ORACLE_HOME and how. Is
> it something like "SetEnv ORACLE_HOME /oracle/product/8.1.7"
> added in httpd.conf?
That's one way to do it.
> I think that I can do a similar thing in my Perl script directly ( I'm
> pretty new to Perl but do recall that I can set an environment
> variable in Perl ) but I don't want to have to do that to every Perl
> script, a more global solution is preferable and much more elegant.
If you put all your environment settings in a single perl file, perhaps
called My_Ora_Config.pm, then you could simply add a line "use
My_Ora_Config;" some point before the line which says "use DBI;"
Inside of My_Ora_Config.pm you would have a line like the following:
$ENV{ORACLE_HOME} = "/oracle/product/8.1.7"
And maybe some other environment settings.
Of course, you still would have to add the "use" line to every script
which uses DBI, so maybe that's not so hot an idea. I would go with
putting the line in httpd.conf
--
Klein bottle for rent - inquire within.