Re: Perl, Oracle, and a browser

From: KandoCoder <yewneek_at_iwon.com>
Date: Sun, 02 Dec 2001 23:26:54 GMT
Message-ID: <2NyO7.575898$ME2.79892743_at_typhoon.kc.rr.com>


Yes, wrong forum, just keep this in mind. When I run a CGI on a UNIX box from the web, I'm running it as use "nobody" usually.
Therefore user "nobody" must have all the environment variables/paths and roles/permissions required to do the job....

[Quoted] Yurasis Dragon <spam_at_smeagol.com> wrote in message news:nfmg0ucbve6sccavr30t76kod4nem23d13_at_4ax.com...
> I'm playing with Perl and DBI and Oracle DBD and have
> been able to get my Perl script read an Oracle database
> and output the results at the command line.
>
> 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
> spam_at_smeagol.com
Received on Mon Dec 03 2001 - 00:26:54 CET

Original text of this message