Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2761
  • Last Modified:

$_ENV array is empty

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
Buz
Asked:
Buz
1 Solution
 
hernst42Commented:
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
 
minichickenCommented:
Does EGPCS stand for ENV, GET, POST, COOKIE, SESSION ??
0
 
BuzAuthor Commented:
Thanks hernst, that was quick and exactly what I've been looking for.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now