Bug #72780 [Opn]: PHP -i and -m do not work with -c

From: Date: Mon, 08 Aug 2016 10:02:19 +0000
Subject: Bug #72780 [Opn]: PHP -i and -m do not work with -c
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-203069@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=72780&edit=1 ID: 72780 Updated by: gooh@php.net Reported by: gooh@php.net Summary: PHP -i and -m do not work with -c Status: Open Type: Bug Package: CGI/CLI related Operating System: any PHP Version: 7.0.9 Block user comment: N Private report: N New Comment: This also affects the CGI SAPI. It does not affect FPM. Previous Comments: ------------------------------------------------------------------------ [2016-08-08 09:23:32] gooh@php.net 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 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=72780&edit=1

« previous php.bugs (#203069) next »