From: hans at parse dot nl
Operating system: Linux
PHP version: 5.2.4RC3
PHP Bug Type: CGI related
Bug description: CGI SAPI does not shut down cleanly with -i/-m/-v cmdline
options
Description:
------------
The CGI SAPI initializes extensions through the regular MINIT/RINIT
functions, but lacks a call to php_request_shutdown() for proper extension
shutdown on some command line options. This is the case for command line
options -v, -i and -m, which call exit(0) without requesting
module/extension shutdown first.
The CLI SAPI *does* clean up nicely after -v/-i/-m and does not exhibit
this behavior.
Reproduce code:
---------------
With CGI SAPI:
# php-cgi -v
PHP 5.2.4RC3 (cgi-fcgi) (built: Aug 27 2007 16:51:33)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with eAccelerator v0.9.6-dev, Copyright (c) 2004-2007 eAccelerator, by
eAccelerator
[23661] EACCELERATOR: PHP unclean shutdown
With CLI SAPI:
# php -v
PHP 5.2.4RC3 (cli) (built: Aug 27 2007 16:51:49)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with eAccelerator v0.9.6-dev, Copyright (c) 2004-2007 eAccelerator, by
eAccelerator
Expected result:
----------------
nice clean shutdown through RSHUTDOWN/MSHUTDOWN.
Actual result:
--------------
exit(0) without shutting down modules/extensions
--
Edit bug report at http://bugs.php.net/?id=42453&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=42453&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=42453&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=42453&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=42453&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=42453&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=42453&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=42453&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=42453&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=42453&r=support
Expected behavior: http://bugs.php.net/fix.php?id=42453&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=42453&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=42453&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=42453&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=42453&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=42453&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=42453&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=42453&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=42453&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=42453&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=42453&r=mysqlcfg