Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

$_ENV array is empty

Posted on 2004-10-11
3
Medium Priority
?
2,724 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 48

Accepted Solution

by:
hernst42 earned 800 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This article discusses how to implement server side field validation and display customized error messages to the client.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

722 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