diff --git a/install/ini.xml b/install/ini.xml index 53b08c4d1a..e4c7887b74 100644 --- a/install/ini.xml +++ b/install/ini.xml @@ -1,101 +1,101 @@ - - Runtime Configuration + + Runtime Configuration - - The configuration file + + The configuration file - - The configuration file (&php.ini;) - is read when PHP starts up. For the server module versions of PHP, - this happens only once when the web server is started. For the - CGI and CLI versions, it happens on - every invocation. - + + The configuration file (&php.ini;) + is read when PHP starts up. For the server module versions of PHP, + this happens only once when the web server is started. For the + CGI and CLI versions, it happens on + every invocation. + + + &php.ini; is searched for in these locations (in order): + + + + SAPI module specific location (PHPIniDir directive + in Apache 2, -c command line option in CGI and CLI, + php_ini parameter in NSAPI, + PHP_INI_PATH environment variable in THTTPD) + + + + + The PHPRC environment variable. Before PHP 5.2.0, + this was checked after the registry key mentioned below. + + + + + As of PHP 5.2.0, the location of the php.ini file + can be set for different versions of PHP. The following registry keys + are examined in order: + [HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x.y.z], + [HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x.y] and + [HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x], where + x, y and z mean the PHP major, minor and release versions. If there is a + value for IniFilePath in any of these keys, the first + one found will be used as the location of the php.ini + (Windows only). + + + + + [HKEY_LOCAL_MACHINE\SOFTWARE\PHP], value of + IniFilePath (Windows only). + + + + + Current working directory (except CLI). + + + + + The web server's directory (for SAPI modules), or directory of PHP + (otherwise in Windows). + + + + + Windows directory (C:\windows + or C:\winnt) (for Windows), or + --with-config-file-path compile time option. + + + + + + If php-SAPI.ini exists (where SAPI is the SAPI in use, + so, for example, php-cli.ini or + php-apache.ini), it is used instead of &php.ini;. + The SAPI name can be determined with php_sapi_name. + + - &php.ini; is searched for in these locations (in order): - - - - SAPI module specific location (PHPIniDir directive - in Apache 2, -c command line option in CGI and CLI, - php_ini parameter in NSAPI, - PHP_INI_PATH environment variable in THTTPD) - - - - - The PHPRC environment variable. Before PHP 5.2.0, - this was checked after the registry key mentioned below. - - - - - As of PHP 5.2.0, the location of the php.ini file - can be set for different versions of PHP. The following registry keys - are examined in order: - [HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x.y.z], - [HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x.y] and - [HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x], where - x, y and z mean the PHP major, minor and release versions. If there is a - value for IniFilePath in any of these keys, the first - one found will be used as the location of the php.ini - (Windows only). - - - - - [HKEY_LOCAL_MACHINE\SOFTWARE\PHP], value of - IniFilePath (Windows only). - - - - - Current working directory (except CLI). - - - - - The web server's directory (for SAPI modules), or directory of PHP - (otherwise in Windows). - - - - - Windows directory (C:\windows - or C:\winnt) (for Windows), or - --with-config-file-path compile time option. - - - + The Apache web server changes the directory to root at startup, causing + PHP to attempt to read &php.ini; from the root filesystem if it exists. - - If php-SAPI.ini exists (where SAPI is the SAPI in use, - so, for example, php-cli.ini or - php-apache.ini), it is used instead of &php.ini;. - The SAPI name can be determined with php_sapi_name. - - - - The Apache web server changes the directory to root at startup, causing - PHP to attempt to read &php.ini; from the root filesystem if it exists. - - - - The &php.ini; directives handled by extensions are documented - on the respective pages of the extensions themselves. A list of - the core directives is available in the appendix. Not all - PHP directives are necessarily documented in this manual: for a complete list - of directives available in your PHP version, please read your well commented - &php.ini; file. Alternatively, you may find - the latest &php.ini; from SVN - helpful too. - - - - &php.ini; example - + + + The &php.ini; directives handled by extensions are documented + on the respective pages of the extensions themselves. A list of + the core directives is available in the appendix. Not all + PHP directives are necessarily documented in this manual: for a complete list + of directives available in your PHP version, please read your well commented + &php.ini; file. Alternatively, you may find + the latest &php.ini; from SVN + helpful too. + + + + &php.ini; example + - - - - Since PHP 5.1.0, it is possible to refer to existing .ini variables from - within .ini files. Example: open_basedir = ${open_basedir} - ":/new/dir". - - - - - .user.ini files - - - Since PHP 5.3.0, PHP includes support for .htaccess-style INI files on a - per-directory basis. These files are processed only by - the CGI/FastCGI SAPI. This functionality obsoletes the PECL htscanner - extension. If you are using Apache, use &htaccess; files for the same - effect. - - - - In addition to the main &php.ini; file, PHP scans for INI files in each - directory, starting with the directory of the requested PHP file, and - working its way up to the current document root (as set in - $_SERVER['DOCUMENT_ROOT']). In case the PHP file is - outside the document root, only its directory is scanned. - - - Only INI settings with the - modes PHP_INI_PERDIR and - PHP_INI_USER will be recognized in .user.ini-style INI - files. - - - - Two new INI directives, - user_ini.filename and - user_ini.cache_ttl - - control the use of user INI files. - - - - user_ini.filename sets the name of the file PHP looks for - in each directory; if set to an empty string, PHP doesn't scan at all. The - default is .user.ini. - - - - user_ini.cache_ttl controls how often user INI files are - re-read. The default is 300 seconds (5 minutes). - - + + + + Since PHP 5.1.0, it is possible to refer to existing .ini variables from + within .ini files. Example: open_basedir = ${open_basedir} + ":/new/dir". + + - - Where a configuration setting may be set + + .user.ini files + + + Since PHP 5.3.0, PHP includes support for .htaccess-style INI files on a + per-directory basis. These files are processed only by + the CGI/FastCGI SAPI. This functionality obsoletes the PECL htscanner + extension. If you are using Apache, use &htaccess; files for the same + effect. + + + + In addition to the main &php.ini; file, PHP scans for INI files in each + directory, starting with the directory of the requested PHP file, and + working its way up to the current document root (as set in + $_SERVER['DOCUMENT_ROOT']). In case the PHP file is + outside the document root, only its directory is scanned. + + + Only INI settings with the + modes PHP_INI_PERDIR and + PHP_INI_USER will be recognized in .user.ini-style INI + files. + + + + Two new INI directives, + user_ini.filename and + user_ini.cache_ttl + + control the use of user INI files. + + + + user_ini.filename sets the name of the file PHP looks for + in each directory; if set to an empty string, PHP doesn't scan at all. The + default is .user.ini. + + + + user_ini.cache_ttl controls how often user INI files are + re-read. The default is 300 seconds (5 minutes). + + + + + Where a configuration setting may be set + + + These modes determine when and where a PHP directive may or may not + be set, and each directive within the manual refers to one of these + modes. For example, some settings may be set within a PHP script + using ini_set, whereas others may require + &php.ini; or &httpd.conf;. + + + + For example, the + output_buffering setting + is PHP_INI_PERDIR therefore it may not be set using + ini_set. However, the + display_errors directive is + PHP_INI_ALL therefore it may be set anywhere, + including with ini_set. + + + + + Definition of PHP_INI_* modes + + + + Mode + Meaning + + + + + PHP_INI_USER + + Entry can be set in user scripts (like with ini_set) + or in the Windows registry + + + + PHP_INI_PERDIR + Entry can be set in &php.ini;, &htaccess; or &httpd.conf; + + + PHP_INI_SYSTEM + Entry can be set in &php.ini; or &httpd.conf; + + + PHP_INI_ALL + Entry can be set anywhere + + + +
+
+
+ + + How to change configuration settings + + + Running PHP as an Apache module + + When using PHP as an Apache module, you can also change the + configuration settings using directives in Apache configuration + files (e.g. &httpd.conf;) and &htaccess; files. You will need + "AllowOverride Options" or "AllowOverride All" privileges to do so. + - These modes determine when and where a PHP directive may or may not - be set, and each directive within the manual refers to one of these - modes. For example, some settings may be set within a PHP script - using ini_set, whereas others may require - &php.ini; or &httpd.conf;. + There are several Apache directives that allow you + to change the PHP configuration from within the Apache configuration + files. For a listing of which directives are + PHP_INI_ALL, PHP_INI_PERDIR, + or PHP_INI_SYSTEM, have a look at the + List of php.ini directives appendix. - For example, the - output_buffering setting - is PHP_INI_PERDIR therefore it may not be set using - ini_set. However, the - display_errors directive is - PHP_INI_ALL therefore it may be set anywhere, - including with ini_set. + + + + php_value + name + value + + + + Sets the value of the specified directive. + Can be used only with PHP_INI_ALL and PHP_INI_PERDIR type directives. + To clear a previously set value use none as the value. + + + + Don't use php_value to set boolean values. + php_flag (see below) should be used instead. + + + + + + + php_flag + name + on|off + + + + Used to set a boolean configuration directive. + Can be used only with PHP_INI_ALL and + PHP_INI_PERDIR type directives. + + + + + + php_admin_value + name + value + + + + Sets the value of the specified directive. + This can not be used in &htaccess; files. + Any directive type set with php_admin_value + can not be overridden by &htaccess; or ini_set. + To clear a previously set value use none as the value. + + + + + + php_admin_flag + name + on|off + + + + Used to set a boolean configuration directive. + This can not be used in &htaccess; files. + Any directive type set with php_admin_flag + can not be overridden by &htaccess; or ini_set. + + + + - - - Definition of PHP_INI_* modes - - - - Mode - Meaning - - - - - PHP_INI_USER - - Entry can be set in user scripts (like with ini_set) - or in the Windows registry - - - - PHP_INI_PERDIR - Entry can be set in &php.ini;, &htaccess; or &httpd.conf; - - - PHP_INI_SYSTEM - Entry can be set in &php.ini; or &httpd.conf; - - - PHP_INI_ALL - Entry can be set anywhere - - - -
-
-
- - - How to change configuration settings - - - Running PHP as an Apache module - - When using PHP as an Apache module, you can also change the - configuration settings using directives in Apache configuration - files (e.g. &httpd.conf;) and &htaccess; files. You will need - "AllowOverride Options" or "AllowOverride All" privileges to do so. - - - - There are several Apache directives that allow you - to change the PHP configuration from within the Apache configuration - files. For a listing of which directives are - PHP_INI_ALL, PHP_INI_PERDIR, - or PHP_INI_SYSTEM, have a look at the - List of php.ini directives appendix. - - - - - - - php_value - name - value - - - - Sets the value of the specified directive. - Can be used only with PHP_INI_ALL and PHP_INI_PERDIR type directives. - To clear a previously set value use none as the value. - - - - Don't use php_value to set boolean values. - php_flag (see below) should be used instead. - - - - - - - php_flag - name - on|off - - - - Used to set a boolean configuration directive. - Can be used only with PHP_INI_ALL and - PHP_INI_PERDIR type directives. - - - - - - php_admin_value - name - value - - - - Sets the value of the specified directive. - This can not be used in &htaccess; files. - Any directive type set with php_admin_value - can not be overridden by &htaccess; or ini_set. - To clear a previously set value use none as the value. - - - - - - php_admin_flag - name - on|off - - - - Used to set a boolean configuration directive. - This can not be used in &htaccess; files. - Any directive type set with php_admin_flag - can not be overridden by &htaccess; or ini_set. - - - - - - - - Apache configuration example - + + Apache configuration example + php_value include_path ".:/usr/local/lib/php" @@ -331,62 +331,62 @@ include_path = ".;c:\php\lib" php_admin_flag engine on ]]> - - - - - - PHP constants do not exist outside of PHP. For example, in - &httpd.conf; you can not use PHP constants - such as E_ALL or E_NOTICE - to set the error_reporting - directive as they will have no meaning and will evaluate to - 0. Use the associated bitmask values instead. - These constants can be used in &php.ini; - - - - - - Changing PHP configuration via the Windows registry - - When running PHP on Windows, the configuration values can be - modified on a per-directory basis using the Windows registry. The - configuration values are stored in the registry key - HKLM\SOFTWARE\PHP\Per Directory Values, - in the sub-keys corresponding to the path names. For example, configuration - values for the directory c:\inetpub\wwwroot would - be stored in the key HKLM\SOFTWARE\PHP\Per Directory - Values\c\inetpub\wwwroot. The settings for the - directory would be active for any script running from this - directory or any subdirectory of it. The values under the key - should have the name of the PHP configuration directive and the - string value. PHP constants in the values are not parsed. - However, only configuration values changeable in - PHP_INI_USER can be set - this way, PHP_INI_PERDIR values can not. - - - - - Other interfaces to PHP + + + + - Regardless of how you run PHP, you can change certain values at runtime - of your scripts through ini_set. See the documentation - on the ini_set page for more information. + PHP constants do not exist outside of PHP. For example, in + &httpd.conf; you can not use PHP constants + such as E_ALL or E_NOTICE + to set the error_reporting + directive as they will have no meaning and will evaluate to + 0. Use the associated bitmask values instead. + These constants can be used in &php.ini; - - If you are interested in a complete list of configuration settings - on your system with their current values, you can execute the - phpinfo function, and review the resulting - page. You can also access the values of individual configuration - directives at runtime using ini_get or - get_cfg_var. - - - + + -
+ + Changing PHP configuration via the Windows registry + + When running PHP on Windows, the configuration values can be + modified on a per-directory basis using the Windows registry. The + configuration values are stored in the registry key + HKLM\SOFTWARE\PHP\Per Directory Values, + in the sub-keys corresponding to the path names. For example, configuration + values for the directory c:\inetpub\wwwroot would + be stored in the key HKLM\SOFTWARE\PHP\Per Directory + Values\c\inetpub\wwwroot. The settings for the + directory would be active for any script running from this + directory or any subdirectory of it. The values under the key + should have the name of the PHP configuration directive and the + string value. PHP constants in the values are not parsed. + However, only configuration values changeable in + PHP_INI_USER can be set + this way, PHP_INI_PERDIR values can not. + + + + + Other interfaces to PHP + + Regardless of how you run PHP, you can change certain values at runtime + of your scripts through ini_set. See the documentation + on the ini_set page for more information. + + + If you are interested in a complete list of configuration settings + on your system with their current values, you can execute the + phpinfo function, and review the resulting + page. You can also access the values of individual configuration + directives at runtime using ini_get or + get_cfg_var. + + + + +