Bug #72780 [NEW]: PHP -i and -m do not work with -c
| From: | gooh@php.net | Date: | Mon, 08 Aug 2016 09:23:34 +0000 |
| Subject: | Bug #72780 [NEW]: PHP -i and -m do not work with -c | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-203057@lists.php.net to get a copy of this message | ||
From: gooh
Operating system: any
PHP version: 7.0.9
Package: CGI/CLI related
Bug Type: Bug
Bug description:PHP -i and -m do not work with -c
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 bug report at https://bugs.php.net/bug.php?id=72780&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=72780&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=72780&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=72780&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=72780&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=72780&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=72780&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=72780&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=72780&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=72780&r=support
Expected behavior: https://bugs.php.net/fix.php?id=72780&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=72780&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=72780&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=72780&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=72780&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=72780&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=72780&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=72780&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=72780&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=72780&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=72780&r=mysqlcfg