Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^3: Connecting to Oracle DB using DBI from CGI script

by afoken (Abbot)
on Jul 05, 2010 at 15:26 UTC ( #848077=note: print w/replies, xml ) Need Help??


in reply to Re^2: Connecting to Oracle DB using DBI from CGI script
in thread Connecting to Oracle DB using DBI from CGI script

If you set up Oracle environment variables inside a script that loads the Oracle client libraries, you have to set up the variables before the libraries are loaded:

  • You can set up %ENV in a BEGIN block, at least before loading DBD::Oracle implicitly via DBI->connect() or explicitly, better even before loading DBI.
  • You can wrap your script in a shell script that sets the variables before passing control to your script via exec.
  • You can add PassEnv or SetEnv directives to the Apache configuration.

I prefer the last way, so no script has to be modified and all scripts automatically get the right Oracle configuration.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://848077]
help
Chatterbox?
[1nickt]: Lightning poll: What would you do if stuck on the runway in a plane for seven hours because the airport lost power?
[marto]: If I was travelling with my twins, likely lose my mind :P
[james28909]: is there a bar or something in this airport?

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (9)
As of 2017-12-18 12:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (485 votes). Check out past polls.

    Notices?