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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Fri May 09 12:01:28 2025 UTC