Skip to content

Commit e3a0b2f

Browse files
docs(ini): clarify ini file search/loading approach [php.ini-development]
1 parent ad2904a commit e3a0b2f

File tree

1 file changed

+21
-13
lines changed

1 file changed

+21
-13
lines changed

php.ini-development

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,27 @@
33
;;;;;;;;;;;;;;;;;;;
44
; About php.ini ;
55
;;;;;;;;;;;;;;;;;;;
6-
; PHP's initialization file, generally called php.ini, is responsible for
7-
; configuring many of the aspects of PHP's behavior.
8-
9-
; PHP attempts to find and load this configuration from a number of locations.
10-
; The following is a summary of its search order:
11-
; 1. SAPI module specific location.
12-
; 2. The PHPRC environment variable.
13-
; 3. A number of predefined registry keys on Windows
14-
; 4. Current working directory (except CLI)
15-
; 5. The web server's directory (for SAPI modules), or directory of PHP
16-
; (otherwise in Windows)
17-
; 6. The directory from the --with-config-file-path compile time option, or the
18-
; Windows directory (usually C:\windows)
6+
; PHP's primary initialization file, generally called php.ini, is responsible
7+
; for configuring most aspects of PHP's behavior.
8+
;
9+
; PHP locates this file as follows:
10+
; 1. If the active SAPI provides a php.ini path override, that is used.
11+
; 2. Otherwise, PHP builds a search path from:
12+
; - the PHPRC environment variable,
13+
; - on Windows, the path configured in the registry,
14+
; - the current working directory (except for SAPIs that disable this,
15+
; such as CLI),
16+
; - the directory of the PHP executable or SAPI module,
17+
; - the directory specified by the --with-config-file-path compile-time
18+
; option, or the Windows directory (usually C:\windows).
19+
; 3. PHP then looks for php-SAPI.ini in that search path, and if that is not
20+
; found, for php.ini.
21+
;
22+
; After the primary configuration file step, PHP may additionally scan
23+
; for .ini files in the path specified by the PHP_INI_SCAN_DIR
24+
; environment variable, or, if that is not set, by the
25+
; --with-config-file-scan-dir compile-time option.
26+
;
1927
; See the PHP docs for more specific information.
2028
; https://php.net/configuration.file
2129

0 commit comments

Comments
 (0)