Re: Why must I set ORACLE_xxx before starting apache vs inside a script?

From: Date: Tue, 24 Oct 2000 11:45:19 +0000
Subject: Re: Why must I set ORACLE_xxx before starting apache vs inside a script?
References: 1 2 3  Groups: php.db 
Request: Send a blank email to php-db+get-3890@lists.php.net to get a copy of this message
On Mon, Oct 23, 2000 at 11:15:22AM -0700, Paul Fernandez wrote: > Hello Thies, > > Do versions 4.03+ correctly log in to the correct server when altering the > third parameter of ocilogon? > > in other words, > ocilogon("scott","tiger","test") would go to the test database > ocilogon("scott","tiger","production") would go to production. yes - test and production should be defined in tnsnames.ora. that's the way it's supposed to work. > > Unfortunately, I have had scripts use the above technique on PHP 4.0 and I > thought I was writing SQL queries to the development SID when in fact it was > going to production. Since getenv() reports only initial settings, how can > PHP show me that I'm writing to the desired SID? getenv doesn't help. use the 3th parameter in ocilogon. tc > > > > > does PHP successfully set variables via putenv() > > > when it comes to Oracle connections? > > > > no - because the oracle-libs are initialized when apache > > starts - just after the php-module is loaded - but far before > > any script had a chance to call putenv(). sadly enough the > > oracle libs seem to "read" the environment variables only > > when they get initialized. > > > > we could try to delay the init call much more but: > > - i expirienced random problems. > > - if the user switches his ORACLE_SID/ORACLE_HOME in the > > script persistent connections would no longer point to the > > "right" server. > > -- > Paul Fernandez > Webmaster > Structural GenomiX, Inc. > www.stromix.com > 858.558.4850 > > >

« previous php.db (#3890) next »