ID: 25178
Updated by: [EMAIL PROTECTED]
Reported By: david at boe dot es
-Status: Open
+Status: Bogus
Bug Type: OCI8 related
Operating System: Linux
PHP Version: 4.3.2
New Comment:
RTFM, those environment variables has to be set in the shell NOT in the
script. Also, the Apache httpd.conf directive "SetEnv" is not what
you're looking for.
Previous Comments:
------------------------------------------------------------------------
[2003-08-20 10:48:15] david at boe dot es
Description:
------------
For some strange reason, php is not correctly passing the info on some
key oracle env vars (TNS_ADMIN) to the oci8 lib.
getenv() is able to catch the value, but ocilogon not.
The cli version works ok (with standard ENV vars)
Reproduce code:
---------------
I have in my httpd.conf:
setenv ORACLE_HOME /var/oracle/product/8.1.7
setenv TNS_ADMIN /var/oracle/product/8.1.7/network/admin
Script 1:
<?
$tns=getenv('TNS_ADMIN');
echo "$tns<p>";
$conn = ocilogon('publicac',cdnp1m,'wdb2');
?>
returns:
/var/oracle/product/8.1.7/network/admin
Warning: ocilogon(): _oci_open_server: Error while trying to retrieve
text for error ORA-12154 in /web/webboe/kk.php on line 4
Script 2:
<?
putenv("TNS_ADMIN=/var/oracle/product/8.1.7/network/admin");
$tns=getenv('TNS_ADMIN');
echo "$tns<p>";
$conn = ocilogon('publicac',cdnp1m,'wdb2');
?>
returns:
/var/oracle/product/8.1.7/network/admin
and connects OK to the oracle database.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=25178&edit=1