|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61231 Module shutdown only executed for parent process
Submitted: 2012-03-02 00:51 UTC Modified: 2013-10-27 17:59 UTC
From: dylan dot arnold at gmail dot com Assigned: fat (profile)
Status: Closed Package: FPM related
PHP Version: 5.4.0 OS: all
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: dylan dot arnold at gmail dot com
New email:
PHP Version: OS:


 [2012-03-02 00:51 UTC] dylan dot arnold at gmail dot com
When a php-fpm child process shuts down it does not call module shutdown.

Check out sapi/fpm/fpm/fpm_main.c line 1917 in out:

    if (parent) {

I'm pretty sure this should be 

    if (parent) {

This caused us problems in our custom PHP extension because we need to clean up 
when a child exits, closing 
sockets and freeing resources.


Patch attached

patch sapi/fpm/fpm/fpm_main.c fpm_child_mshutdown.patch


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-03-06 04:52 UTC]
-Assigned To: +Assigned To: fat
 [2013-10-27 17:59 UTC]
-Status: Assigned +Status: Closed
 [2013-10-27 17:59 UTC]
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at

 For Windows:
Thank you for the report, and for helping us make PHP better.

Fixed in this commit:
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Mar 29 12:03:44 2023 UTC