CGI Environment setting problem?
| From: | Sloey, James | Date: | Wed, 10 Oct 2001 20:05:36 +0000 |
| Subject: | CGI Environment setting problem? | ||
| Groups: | php.install | ||
| Request: | Send a blank email to php-install+get-4590@lists.php.net to get a copy of this message | ||
I'm having trouble with the database connection to Oracle 8 on Solaris 7 due
to a missing environment variable.
The environment is not set when running from the web server.
In order to get the tests to work I had to add putenv() statements to my
code (see below modifications to /php-4.0.6/pear/DB/tests/oci8/skipif.inc).
I tried setting and exporting ORACLE_HOME in the iPlanet start script
(Enterprise 4.1SP2) but that had no effect.
How do you set an environment variable that sticks???????
Thanks in advance
Jim Sloey
<?php
// This script prints "skip" unless:
// * the ibase extension is built-in or loadable, AND
// * there is a database called "test" accessible
// with no username/password, AND
putenv("ORACLE_HOME=/u01/app/oracle/product/8.0.5");
putenv("ORA_NLS=/u01/app/oracle/product/8.0.5/ocommon/nls/admin/data");
putenv("NLS_LANG=American_America.us7ascii");
if (!extension_loaded("oci8")) {
$dlext = (substr(PHP_OS, 0, 3) == "WIN") ? ".dll" : ".so";
@dl("oci8$dlext");
}
if (!extension_loaded("oci8")) {
die("skip\n");
}
$conn = @OCILogon("system", "manager", "test");
if (!is_resource($conn)) {
die("skip\n");
}
die("made it\n");
?>