Re: getting $_ENV variables
| From: | C.R.Vegelin | Date: | Thu, 10 May 2007 15:05:46 +0000 |
| Subject: | Re: getting $_ENV variables | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-254726@lists.php.net to get a copy of this message | ||
Yes, my PHPinfo shows under configuration: variables_order = GPCS
I will test EGPCS setting in php.ini
But that also means that code using $_ENV cannot be run with hosts hiding the environment settings ?!
And I assume that EGPCS will also affect: <?php print_r($_FILES); ?>
Now with GPCS this script shows also only: Array ( )
So also potential problems with $_FILES with hosts hiding the environment settings ?!
Regards, Cor
----- Original Message ----- From: "Richard Davey" <rich@corephp.co.uk>
To: "php-general@lists.php.n" <php-general@lists.php.net>
Sent: Thursday, May 10, 2007 2:44 PM
Subject: Re: [PHP] getting $_ENV variables
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" -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php