Solved

$_ENV array is empty

Posted on 2004-10-11
3
2,658 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

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 …
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
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.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

867 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now