FAQ

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.

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 2 | next ›
Discussion Overview
groupphp-internals @
categoriesphp
postedNov 11, '10 at 12:01a
activeNov 11, '10 at 10:11p
posts2
users2
websitephp.net

People

Translate

site design / logo © 2022 Grokbase