Jérôme Loyet wrote: > Hi guys, > > I'm sure when FPM should call extensions MINIT and MSHUTDOWN functions. > > MINIT is called once by the master process after it forks any > children. It's done by calling php_module_startup() in > cgi_sapi_module.startup(). > MSHUTDOWN is also called by the master process before exiting and > after it kills all its children. It's done by calling > php_module_shutdown_wrapper(); > > Is it normal behaviour ? Or should MINIT and MSHUTDOWN be also called > in each child process somehow ? > > Thanks > ++ Jerome I think it really depends on the kind of initialization done by the modules. The effective way should be doing MINIT in the parent, then forking and finally MSHUTDOWN on each children (plus the parent).
I think that's what should be tried to be done. However, there may be some modules which not only change its internal status, but also externally: eg. it opens a persistant db connection in MINIT. In such case, the MINIT would need to be done on every child after forking. Perhaps the first could be the default with a configuration option for the second one. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php