|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchesphp-5.4-fpm-add_PHP_FPM_OPTS_to_sysconfig (last revision 2014-12-09 04:35 UTC by guy dot paddock at redbottledesign dot com)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-12-09 04:37 UTC] guy dot paddock at redbottledesign dot com
[2014-12-11 10:57 UTC] remi@php.net
-Status: Open
+Status: Not a bug
-Assigned To:
+Assigned To: remi
[2014-12-11 10:57 UTC] remi@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 13 13:00:01 2025 UTC |
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.