Re: getting $_ENV variables
| From: | Richard Davey | Date: | Thu, 10 May 2007 13:44:06 +0000 |
| Subject: | Re: getting $_ENV variables | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-254721@lists.php.net to get a copy of this message | ||
Daniel Brown wrote:
If it's suggesting that it's an array, that's a little baffling, because that means there are multiple entries (at least two), but they appear to either be null or otherwise unable to display.The $_ENV superb-global contains an array of environment settings, so it's not totally baffling that print_r() on it should return an array. The reason it is empty is because the variables_order setting in the php.ini has had it disabled. The default is: variables_order = "EGPCS" But it must have been changed to: variables_order = "GPCS" Dropping the E (Environment variables) will cause a print_r($_ENV) to be totally empty. Some hosts do this in order to hide the environment settings because they can contain sensitive information such as the CPU identifiers, etc. I've seen the 'cheaper' hosts (especially those hosting on Windows and/or Virtual Servers) disable this so you can't tell what kind of CPU they're using, or where their system drive is. Cheers, Rich -- Zend Certified Engineer http://www.corephp.co.uk "Never trust a computer you can't throw out of a window"