|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2016-08-08 10:02 UTC] gooh@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 23:00:01 2025 UTC |
Description: ------------ When running CLI with the -i or -m flags, one has to specify -c before those to use a custom ini file, otherwise the specified configuration will not be used, e.g. php -i -c /etc/php7/fpm/php.ini | grep "Loaded Configuration File" Loaded Configuration File => /etc/php7/cli/php.ini php -c /etc/php7/fpm/php.ini -i | grep "Loaded Configuration File" Loaded Configuration File => /etc/php7/fpm/php.ini This is because -i and -m will immediately execute instead of processing and config flags: https://github.com/php/php-src/blob/2349332b664887474ed2fb09dcdc4c57d8bb2b85/sapi/cli/php_cli.c#L679-L738 Test script: --------------- Run from shell: php -i -c /etc/php/7.0/fpm/php.ini | grep "Loaded Configuration File" Expected result: ---------------- Loaded Configuration File: /etc/php/7.0/fpm/php.ini Actual result: -------------- Loaded Configuration File => /etc/php/7.0/cli/php.ini