Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:58273 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49006 invoked from network); 28 Feb 2012 20:20:06 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Feb 2012 20:20:06 -0000 Authentication-Results: pb1.pair.com smtp.mail=christopher.jones@oracle.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=christopher.jones@oracle.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain oracle.com from 141.146.126.236 cause and error) X-PHP-List-Original-Sender: christopher.jones@oracle.com X-Host-Fingerprint: 141.146.126.236 acsinet14.oracle.com Received: from [141.146.126.236] ([141.146.126.236:21700] helo=acsinet14.oracle.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CC/52-36673-4F63D4F4 for ; Tue, 28 Feb 2012 15:20:05 -0500 Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by acsinet14.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q1SJjQiO022141 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 28 Feb 2012 19:45:27 GMT Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q1SJj7re017144 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 28 Feb 2012 19:45:08 GMT Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q1SJj0u0002839 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 28 Feb 2012 19:45:04 GMT Received: from abhmt116.oracle.com (abhmt116.oracle.com [141.146.116.68]) by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q1SJix35023307; Tue, 28 Feb 2012 13:44:59 -0600 Received: from [130.35.71.238] (/130.35.71.238) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 28 Feb 2012 11:44:59 -0800 Message-ID: <4F4D2EBA.6000409@oracle.com> Date: Tue, 28 Feb 2012 11:44:58 -0800 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0) Gecko/20120129 Thunderbird/10.0 MIME-Version: 1.0 To: "William A. Rowe Jr." CC: internals@lists.php.net References: <5a1d155ad465d1ec2e6461f5347d859f.squirrel@www.l-i-e.com> <4F4BF1C6.8010104@rowe-clan.net> <4F4C23CB.30402@oracle.com> <4F4D05FE.607@rowe-clan.net> In-Reply-To: <4F4D05FE.607@rowe-clan.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-CT-RefId: str=0001.0A090208.4F4D2EC4.00D5,ss=1,re=0.000,fgs=0 Subject: Re: [PHP-DEV] pecl, zts, non-zts, fastcgi and Apache From: christopher.jones@oracle.com (Christopher Jones) On 02/28/2012 08:51 AM, William A. Rowe Jr. wrote: > 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!) > Thanks for clarifying that there is nothing unexpected (to me) happening and for suggesting using -V. It seems that the PHP installer could do one of two things: 1. Build PHP for the currently installed Apache MPM, using "httpd -V" to identify whether to enable PHP's ZTS mode or not. PHP documentation and/or 'configure' messages should state the MPM shouldn't later be changed to threaded if it was originally prefork. A proviso about ZTS overhead and limitations could be noted. 2. Build PHP with ZTS enabled by default. Allow it to be explicitly disabled during 'configure' There are some variations of the above, depending on the target audience(s) and scope of perceived problem. Chris -- Email: christopher.jones@oracle.com Tel: +1 650 506 8630 Blog: http://blogs.oracle.com/opal/