|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39330 apache2handler does not call shutdown actions before apache child die
Submitted: 2006-11-01 13:16 UTC Modified: 2007-06-01 10:04 UTC
Avg. Score:4.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: isk at ecommerce dot com Assigned: tony2001
Status: Closed Package: Apache2 related
PHP Version: 5.1.6 OS: Linux
Private report: No CVE-ID:
 [2006-11-01 13:16 UTC] isk at ecommerce dot com
apache2handler sapi registers cleanup functions only for 
main apache process.

apr_pool_cleanup_register(pconf, NULL, 
php_apache_server_shutdown, apr_pool_cleanup_null);

The pconf is main apache process pool. But apache 2 cleans 
_only_ child pool before it die.

apache2handler must register cleanup function and for 
child pool. This can be fixed by several strings.

static void php_apache_child_init(apr_pool_t *pchild, 
server_rec *s)
  apr_pool_cleanup_register(pchild, NULL, 
php_apache_server_shutdown, apr_pool_cleanup_null);
void php_ap2_register_hook(apr_pool_t *p)
  ap_hook_child_init(php_apache_child_init, NULL, NULL, 

Without this code the using persistent connection has 
problem in unclean close connection to DB after apache 
child die.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-05-31 11:40 UTC]
I'll commit the patch after 5.2.3 release.
 [2007-05-31 11:44 UTC]
Bug confirmed and patch does work as said.
 [2007-06-01 10:04 UTC]
This bug has been fixed in CVS.

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.

PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Sat Nov 28 20:01:31 2015 UTC