Solved

$_ENV array is empty

Posted on 2004-10-11
3
2,671 Views
Last Modified: 2011-09-20
I'm tring to print the values of $_ENV using PHP 4.3.4 (and 4.3.8) by using the next code:
var_dump($_ENV);

The result of it is:
array(0) { }

While using phpinfo() function I'm getting all the information in the Environment section but still any call for the $_ENV variable returns an empty string:
echo $_ENV["HOST"] ==> Empty string.

I'm sure it worked in previous versions of php with the same code.

Any idea?
0
Comment
Question by:Buz
3 Comments
 
LVL 48

Accepted Solution

by:
hernst42 earned 200 total points
ID: 12274892
make sure your php.ini contains the sollowing setting:
variables_order = "EGPCS"
if the E is missing $_ENV will be empty

See also http://bugs.php.net/bug.php?id=29971
0
 
LVL 12

Expert Comment

by:minichicken
ID: 12274956
Does EGPCS stand for ENV, GET, POST, COOKIE, SESSION ??
0
 
LVL 1

Author Comment

by:Buz
ID: 12275002
Thanks hernst, that was quick and exactly what I've been looking for.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
Generating table dynamically is the most common issue faced by php developers.... So it seems there is a need of an article that explains the basic concept of generating tables dynamically. It just requires a basic knowledge of html and little maths…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question