Re: getting $_ENV variables
| From: | Daniel Brown | Date: | Thu, 10 May 2007 13:44:47 +0000 |
| Subject: | Re: getting $_ENV variables | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-254722@lists.php.net to get a copy of this message | ||
What HTTP server are you using, Apache, IIS, AnalogX SimpleServer?
That last one is actually one of my favorites for simple desktop page
hosting. Tiny, no installation.... boom, there you go.
http://www.analogx.com/ --- There's a bunch of stuff there. No, I'm not
affiliated with them, or advertising for them. Just linking.
On 5/10/07, C.R.Vegelin <cr.vegelin@hetnet.nl> wrote:
Daniel, I did get the result via the web / IE with the address: http://127.0.0.1/test/ENVtest.php with ENVtest.php having: <?php print_r($_ENV); ?> using Windows XP, PHP 5.2.0 ----- Original Message ----- *From:* Daniel Brown <parasane@gmail.com> *To:* C.R.Vegelin <cr.vegelin@hetnet.nl> *Cc:* php-general@lists.php.n *Sent:* Thursday, May 10, 2007 2:24 PM *Subject:* Re: [PHP] getting $_ENV variables-- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107Cor,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.Did you get that result when running the script from the CLI or viathe web? On 5/10/07, C.R.Vegelin < cr.vegelin@hetnet.nl> wrote: Thanks Daniel, Greg, Richard, I made a script with: <?php print_r($_ENV); ?> and it results only into: "Array ( )" nothing else ... So it must be caused by a "different" environment ? All I want is to check the $_ENV['OS'] within PHP scripts. Regards, Cor ----- Original Message ----- *From:* Daniel Brown <parasane@gmail.com> *To:* C.R.Vegelin <cr.vegelin@hetnet.nl> *Cc:* php-general@lists.php.n *Sent:* Wednesday, May 09, 2007 5:26 PM *Subject:* Re: [PHP] getting $_ENV variablesWhen I print_r($_ENV); from the CLI on 5.0.4 I get a bunch ofresults, no problem.... but no $_ENV['OS'] variable. Further, when I check my phpinfo(); output, there are even fewer $_ENV variables printed than the CLI offers.I'm not certain about this, Cor, but my guess is that PHP 5.x.x mayhave altered the default $_ENV output to hide some of this information --- which is a good thing, in my opinion, because then you won't just have some run-of-the-mill script kiddie checking out the details of a box for known security holes.Of course, that doesn't necessarily stop <? passthru('uname-a')."\n"; ?> or checking the $_SERVER['SERVER_SIGNATURE'] variable for the OS information.... so perhaps this response is just one of those white-bread responses. Something to chew on, but you really don't get anything from it. On 5/9/07, C.R.Vegelin <cr.vegelin@hetnet.nl > wrote:Hi All, I get nothing when using: echo $_ENV['OS']; Also nothing when using: print_r($_ENV); However, phpinfo(); show a full list of ENV settings. How to get $_ENV variables ? I am using PHP version 5.2.0. TIA, Cor-- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107