From: isk at ecommerce dot com Operating system: Linux PHP version: 5.1.6 PHP Bug Type: Apache2 related Bug description: apache2handler does not call shutdown actions before apache child die
Description: ------------ apache2handler sapi registers cleanup functions only for main apache process. php_apache_server_startup(){ ... 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. sapi/apache2handler/sapi_apache2.c: 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, APR_HOOK_MIDDLE); } Without this code the using persistent connection has problem in unclean close connection to DB after apache child die. -- Edit bug report at http://bugs.php.net/?id=39330&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=39330&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=39330&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=39330&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=39330&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=39330&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=39330&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=39330&r=needscript Try newer version: http://bugs.php.net/fix.php?id=39330&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=39330&r=support Expected behavior: http://bugs.php.net/fix.php?id=39330&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=39330&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=39330&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=39330&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39330&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=39330&r=dst IIS Stability: http://bugs.php.net/fix.php?id=39330&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=39330&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=39330&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=39330&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=39330&r=mysqlcfg