On 2/27/2012 6:46 PM, Christopher Jones wrote:
> 
> On 02/27/2012 01:12 PM, William A. Rowe Jr. wrote:
>> On 2/27/2012 6:58 AM, jpauli wrote:
> 
>>> Recently we had a bug with the new Apache 2.4 API where apxs doesn't answer
>>> about the MPM configuration anymore, leading to a ZTS build by default.
>>> This bug has now been fixed, was https://bugs.php.net/bug.php?id=61172.
>>
>> Wrong fix.  Out of the box you don't know which mpm may be loaded, because
>> the mpm is now loadable (although a full daemon stop/start is necessary).
> 
> Can you expand & explain this, with an eye to resolving 61172?
> Are you saying Apache 2.4 'httpd -M' might not return the mpm?

The mpm is now a loadable module, not compiled in.  The recommended default mpm
is now event, the recommended .rpm proposes shipping event/worker/prefork, all
as modules.  The user is *free* to switch mpm's at any point by simply editing
their httpd.conf file, so what was a non-threaded server becomes a threaded one.

httpd -l will not return what you want, httpd -M will, but is not the right
solution...

# bin/httpd -l
Compiled in modules:
  core.c
  mod_so.c
  http_core.c

# bin/httpd -M
Loaded Modules:
 core_module (static)
 so_module (static)
 http_module (static)
...
 version_module (shared)
 mpm_event_module (shared)
 unixd_module (shared)
...

The httpd -V command was always the correct way to test for threaded'ness,
which would allow supporting an mpm which was not known to you.  Again, it
will only reflect the currently loaded module (and fail if no MPM is loaded);

# bin/httpd -V
Server version: Apache/2.4.1 (Unix)
Server built:   Feb 28 2012 10:37:32
Server's Module Magic Number: 20120211:0
Server loaded:  APR 1.4.5, APR-UTIL 1.3.12
Compiled using: APR 1.4.5, APR-UTIL 1.3.12
Architecture:   64-bit
Server MPM:     event
  threaded:     yes (fixed thread count)
    forked:     yes (variable process count)
...

Editing httpd.conf... s/event/prefork/ results in
...
Server MPM:     prefork
  threaded:     no
    forked:     yes (variable process count)

In 2.2 the default MPM became worker.  In 2.4 the default MPM is now event,
so prefork hasn't been the default in some 7 years.  The only sensible build
for mod_php is ZTS, which will load and operate whichever mpm is loaded by
the user.  The only sensible single thread environment is cgi (enhanced,
of course, with fastcgi!)


-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to