php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18037 SetEnv directive gets reported in _SERVER superglobals, not _ENV or environment
Submitted: 2002-06-28 02:02 UTC Modified: 2002-06-28 02:15 UTC
From: robert at ud dot com Assigned:
Status: Not a bug Package: Apache2 related
PHP Version: 4.2.1 OS: Linux RH 7.2
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: robert at ud dot com
New email:
PHP Version: OS:

 

 [2002-06-28 02:02 UTC] robert at ud dot com
When using the SetEnv directive in the Apache2 httpd.conf file to set (and pass) an environment variable to PHP, the variable name/value pair is showing up in the _SERVER superglobals array, not the _ENV array or even the Environment list on a phpinfo() output page.

This is Apache 2.0.36 and PHP 4.2.1

The only way I can get real environment variables into PHP is set/export them in my shell prior to running the Apache2 binary.  Doing it from the Apache2 httpd.conf file via the SetEnv is not working.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-28 02:07 UTC] robert at ud dot com
For example:

In my httpd.conf:
SetEnv TESTPATH /usr/local

...gets reported in phpinfo() as:
_SERVER["TESTPATH"] = /usr/local

It does not show up in the _ENV array, and definitely not in the Environment list.
 [2002-06-28 02:15 UTC] sniper@php.net
It goes into the Apache environment which is found via $_SERVER. Not bug.

 
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Feb 03 10:03:43 2023 UTC