Req #68570 [NEW]: Add support for specifying command-line options in /etc/sysconfig/php-fpm
| From: | guy dot paddock at redbottledesign dot com | Date: | Tue, 09 Dec 2014 04:34:42 +0000 |
| Subject: | Req #68570 [NEW]: Add support for specifying command-line options in /etc/sysconfig/php-fpm | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-188967@lists.php.net to get a copy of this message | ||
From: guy dot paddock at redbottledesign dot com
Operating system: Redhat-based
PHP version: 5.4.35
Package: FPM related
Bug Type: Feature/Change Request
Bug description:Add support for specifying command-line options in /etc/sysconfig/php-fpm
Description:
------------
Currently, the "/etc/init.d/php-fpm" init script loads additional
environment variables from "/etc/sysconfig/php-fpm", as is a standard
pattern for a RedHat init scripts.
Unfortunately, there's currently nothing useful that one can put in that
file because there are no variables that the init script currently
expects to be defined in "/etc/sysconfig/php-fpm".
This is a missed opportunity. I propose that this line in the "start()"
portion of the init script:
daemon --pidfile ${pidfile} php-fpm --daemonize
Be changed to this:
daemon --pidfile ${pidfile} php-fpm --daemonize ${PHP_FPM_OPTS}
To enable /etc/sysconfig/php-fpm to contain additional command-line
options (such as PHP option definitions, etc) to be supplied.
With this simple change, we can then provide options in
/etc/sysconfig/php-fpm like so:
PHP_FPM_OPTS="-d newrelic.appname='PHP-FPM Application
Environment'"
In the example above, we use this to force the name of the application
reported for any PHP scripts running through FPM to be flagged as such.
This is only one such example, but anything is possible.
If you're wondering why one cannot simply just specify settings in the
system-wide php.ini or in the global config, it's because on shared
hosting systems (especially those managed by a panel like Plesk or
cPanel), the global php.ini is shared between FPM and FastCGI or Apache
PHP; the global config does not support PHP settings; and the FPM pool
configs are often auto-generated and not modifiable.
--
Edit bug report at https://bugs.php.net/bug.php?id=68570&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=68570&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=68570&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=68570&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=68570&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=68570&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=68570&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=68570&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=68570&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=68570&r=support
Expected behavior: https://bugs.php.net/fix.php?id=68570&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=68570&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=68570&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=68570&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68570&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=68570&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=68570&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=68570&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=68570&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=68570&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=68570&r=mysqlcfg