|  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
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.


Add a Patch

Pull Requests

Add a Pull Request


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]
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: Sat Apr 01 15:03:39 2023 UTC