php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25178 php not passing env vars to oci8 libs as an apache module
Submitted: 2003-08-20 10:48 UTC Modified: 2003-08-20 17:41 UTC
From: david at boe dot es Assigned:
Status: Not a bug Package: OCI8 related
PHP Version: 4.3.2 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: david at boe dot es
New email:
PHP Version: OS:

 

 [2003-08-20 10:48 UTC] 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.




Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-08-20 17:41 UTC] sniper@php.net
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.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 13:01:32 2024 UTC