|  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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
27 + 8 = ?
Subscribe to this entry?

 [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-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 02:01:29 2024 UTC