note 92206 deleted from reserved.variables.server by danbrown
| From: | danbrown@php.net | Date: | Tue, 14 Jul 2009 14:41:58 +0000 |
| Subject: | note 92206 deleted from reserved.variables.server by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-158276@lists.php.net to get a copy of this message | ||
Note Submitter: rowan dot collins at gmail dot com
----
In reply to Richard York, the reason the additional variables are not documented here is that they
are not being set by PHP, but are inherited from the "environment" in which it is run.
In the command-line case, this is the shell that ran the PHP command, and current environment
variables can usually be listed by running "set". Many will be set by the shell itself,
which will document their purpose (see documentation for your shell, e.g. "man bash").
In a web environment, there may also be additional environment variables set by the web server. This
can be used to pass information from an Apache configuration file into the PHP script, e.g.:
# in apache config file
SetEnv site_mode Live
# in PHP file
<?php if ( $_SERVER['site_mode'] == 'Live' ) { ... } ?>