httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Saju Pillai" <>
Subject Re: PHP Extension Deinitializing on Startup
Date Sat, 21 Apr 2007 02:28:25 GMT
On 20/04/07, Joe Lewis <> wrote:
> Michael B Allen wrote:
> > Hi Saju,
> >
> > Actually I'm not sure this is my problem. I have tested my PHP extension
> > on numerous platforms and I have only ever seen the PHP extension
> > initialization / deinitialization routines run once for each restart.
> >
> > Is the "load -> unload -> load" behavior you describe something new that
> > Apache just started doing?
> >
> Apache has been doing that for eons. But apache does it to the apache
> extensions, while PHP would do it to the PHP extensions. I really expect
> that you should be working with the PHP lists rather than here from the
> original posting. (See for one that
> might fit your needs).
> Saju is absolutely correct - when a module is loaded by apache, a hook
> called post_config() is called twice (for checking the config file first
> that the syntax is okay, and then for the actual configuration), but I'm
> not sure if the .so is free()d from memory during that process. I always
> thought that it did not actually reload the .so (correct me if I am wrong).

mod_so loads a module using apr_dso_load() . This call registers a
pool cleanup callback that is called during config pool clearing to
unload the dso.

Without all modules getting unloaded in a restart cycle, you would not
be able to get rid of a module across restarts by commenting out it's


> Forcing an extension to "deinitialize" in PHP because of an issue in
> Apache would cause every extension in PHP to "deinitialize", not just
> one of them. I expect the issue to be in the php extension itself (or
> php, but that is unlikely).
> Joe
> --
> Joseph Lewis <>
> "Divide the fire, and you will sooner put it out." - Publius Syrus

View raw message