|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72780 PHP -i and -m do not work with -c
Submitted: 2016-08-08 09:23 UTC Modified: 2016-08-08 10:02 UTC
Avg. Score:4.0 ± 1.0
Reproduced:5 of 5 (100.0%)
Same Version:5 (100.0%)
Same OS:5 (100.0%)
From: Assigned:
Status: Open Package: CGI/CLI related
PHP Version: 7.0.9 OS: any
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2016-08-08 09:23 UTC]
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:

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


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2016-08-08 10:02 UTC]
This also affects the CGI SAPI. It does not affect FPM.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jul 13 19:01:30 2024 UTC