Solved

$_ENV array is empty

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Encode a password 2 39
html input clean up 3 32
delete database record with modal 21 34
XML Data Missing in PHP SimpleXML 8 24
Introduction Many web sites contain image galleries; a common design for these galleries includes a page with a collection of thumbnail images.  You can click on each of the thumbnail images to see the larger version of the image.  This is easily i…
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…
The viewer will learn how to count occurrences of each item in an array.
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.

746 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

10 Experts available now in Live!

Get 1:1 Help Now