Re: Why must I set ORACLE_xxx before starting apache vs inside a script?
| From: | Paul Fernandez | Date: | Mon, 23 Oct 2000 18:15:22 +0000 |
| Subject: | Re: Why must I set ORACLE_xxx before starting apache vs inside a script? | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-3866@lists.php.net to get a copy of this message | ||
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.
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?
> > 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