|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #54172 Overriding the pid file location of php-fpm
Submitted: 2011-03-06 10:18 UTC Modified: 2011-07-02 19:39 UTC
From: olemarkus at gentoo dot org Assigned: fat
Status: Closed Package: FPM related
PHP Version: 5.3.5 OS:
Private report: No CVE-ID:
 [2011-03-06 10:18 UTC] olemarkus at gentoo dot org
After Gentoo added FPM support, one of the most-reported issues we have related to FPM is to make sure the PID file location in the FPM configuration and the one in the init script match each other. Currently we set a fixed pid location in the config file and the init script expects that this config is not changed. If a user change the pid file location, the init script stops working. The only alternative solution I have seen so far is to use to try to grep the pid location from the config, but at least the attempt done by the dotdeb maintainer to do this did not work very well.

It would be nice if an argument could be added to the php-fpm binary allowing init-scripts to specify the pid file location directly, overriding any location configured in the FPM configuration file. 


fpm-pid.v1.patch (last revision 2011-07-02 17:39 UTC) by

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-07-02 13:38 UTC]
-Status: Open +Status: Assigned -Assigned To: +Assigned To: fat
 [2011-07-02 13:39 UTC]
The following patch has been added/updated:

Patch Name: fpm-pid.v1.patch
Revision:   1309628366
 [2011-07-02 13:42 UTC]
-Status: Assigned +Status: Feedback
 [2011-07-02 13:42 UTC]
Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.

Can you please test the attached patch and tell me if it seems to be OK with 

I've added a -g (or --pid) to php-fpm binary to specify the pid file. 

Note: if the pid is also defined in php-fpm.conf, an error is thrown because the 
pid is defined twice. So you should remove the pid line in the php-fpm.conf 
you're providing and add a comment NOT to use it in order not to interfere with 
your init.d script.

++ jerome
 [2011-07-02 15:16 UTC] olemarkus at gentoo dot org
-Status: Feedback +Status: Assigned
 [2011-07-02 15:16 UTC] olemarkus at gentoo dot org
It looks good to me. I've applied the patch to the 5.3.7 RC2 source and modified the Gentoo fpm conf and init scripts; it seems to be working as I want it to.

 [2011-07-02 19:39 UTC]
-Status: Assigned +Status: Closed
 [2011-07-02 19:39 UTC]
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

 [2011-07-02 19:41 UTC]
Automatic comment from SVN on behalf of fat
Log: - Implemented FR #54172 (Overriding the pid file location of php-fpm)
PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Wed Dec 02 03:01:32 2015 UTC