From f79db1baf158d1a68ce29e756c83d37e038075d9 Mon Sep 17 00:00:00 2001 From: Damien Seguy Date: Mon, 25 Jun 2001 13:39:59 +0000 Subject: [PATCH] Adding some details about putenv and safe mode (from php.ini). git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@50181 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/info.xml | 47 +++++++++++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 15 deletions(-) diff --git a/functions/info.xml b/functions/info.xml index 1172ae7ab9..8f53a526ee 100644 --- a/functions/info.xml +++ b/functions/info.xml @@ -31,7 +31,7 @@ Assertion should be used as a debugging feature only. You may use them for sanity-checks that test for conditions that should - always be TRUE and that indicate some programming errors if not + always be TRUE and that indicate some programming errors if not or to check for the presence of certain features like extension functions or certain system limits and features. @@ -139,7 +139,7 @@ - Returns TRUE if the extension identified by + Returns TRUE if the extension identified by name is loaded. You can see the names of various extensions by using phpinfo. @@ -191,8 +191,7 @@ Returns the value of the environment variable - varname, or FALSE on an error. - + varname, or FALSE on an error. $ip = getenv ("REMOTE_ADDR"); // get the ip number of the user @@ -203,9 +202,8 @@ $ip = getenv ("REMOTE_ADDR"); // get the ip number of the user You can see a list of all the environmental variables by using phpinfo. You can find out what many of them mean by taking a look at the CGI - specification, specifically the page on - environmental variables. + specification, specifically the page on + environmental variables. This function does not work in ISAPI mode. @@ -236,7 +234,7 @@ $ip = getenv ("REMOTE_ADDR"); // get the ip number of the user Returns the current value of the PHP configuration variable - specified by varname, or FALSE if an error + specified by varname, or FALSE if an error occurs. @@ -353,7 +351,7 @@ $ip = getenv ("REMOTE_ADDR"); // get the ip number of the user Returns the time of the last modification of the current page. The value returned is a Unix timestamp, suitable for - feeding to date. Returns FALSE on error. + feeding to date. Returns FALSE on error. getlastmod() example @@ -386,7 +384,7 @@ echo "Last modified: ".date ("F d Y H:i:s.", getlastmod()); - Returns the current script's inode, or FALSE on error. + Returns the current script's inode, or FALSE on error. See also getmyuid, @@ -416,7 +414,7 @@ echo "Last modified: ".date ("F d Y H:i:s.", getlastmod()); - Returns the current PHP process ID, or FALSE on error. + Returns the current PHP process ID, or FALSE on error. @@ -448,7 +446,7 @@ echo "Last modified: ".date ("F d Y H:i:s.", getlastmod()); - Returns the user ID of the current script, or FALSE on error. + Returns the user ID of the current script, or FALSE on error. See also getmypid, @@ -1265,8 +1263,26 @@ if (substr(php_uname(), 0, 7) == "Windows") { Adds setting to the server environment. The -environment variable will only exist for the duration of the current request. -At the end of the request the environment is restored to its original state. + environment variable will only exist for the duration of the current + request. At the end of the request the environment is restored to + its original state. + + + Setting certain environment variables may be a potential security breach. + The safe_mode_allowed_env_vars directive contains a + comma-delimited list of prefixes. In Safe Mode, the user may only + alter environment variables whose names begin with the prefixes + supplied by this directive. By default, users will only be able + to set environment variables that begin with PHP_ + (e.g. PHP_FOO=BAR). Note: if this directive is empty, + PHP will let the user modify ANY environment variable! + + + The safe_mode_protected_env_vars directive + contains a comma-delimited list of environment variables, that + the end user won't be able to change using putenv. + These variables will be protected even if safe_mode_allowed_env_vars + is set to allow to change them. @@ -1425,7 +1441,8 @@ Array - See also: get_loaded_extensions. + See also + get_loaded_extensions.