docs(ini): Clarify php.ini search order and additional .ini scan path in configuration docs#21503
Open
joshtrichards wants to merge 2 commits intophp:masterfrom
Open
docs(ini): Clarify php.ini search order and additional .ini scan path in configuration docs#21503joshtrichards wants to merge 2 commits intophp:masterfrom
joshtrichards wants to merge 2 commits intophp:masterfrom
Conversation
iluuu1994
reviewed
Mar 23, 2026
Member
iluuu1994
left a comment
There was a problem hiding this comment.
Honestly, I'm not totally convinced this is the right place to document this anyway. INI files are migrated from one PHP version to the next, and this documentation is bound to get outdated.
| ; for configuring most aspects of PHP's behavior. | ||
| ; | ||
| ; PHP locates this file as follows: | ||
| ; 1. If the active SAPI provides a php.ini path override, that is used. |
Member
There was a problem hiding this comment.
I believe this is a bit more complicated. The ini override path is used both as a file name and path. Meaning, if a full file is specified, that file is used (e.g. for php-cgi -c /full/path/php.ini). However, a directory can also be specified, in which case PHP will still look for a php-{sapi}.ini and php.ini file in that directory.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improve the
php.iniconfiguration-file documentation to better match the implementation and make the loading process clearer.This update:
php-SAPI.inibeforephp.ini,.inifiles viaPHP_INI_SCAN_DIRor--with-config-file-scan-dir.Same change in both production and development sample ini file.