Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68574 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 36116 invoked from network); 19 Aug 2013 23:17:36 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Aug 2013 23:17:36 -0000 Authentication-Results: pb1.pair.com smtp.mail=jdavidlists@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=jdavidlists@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.174 as permitted sender) X-PHP-List-Original-Sender: jdavidlists@gmail.com X-Host-Fingerprint: 209.85.223.174 mail-ie0-f174.google.com Received: from [209.85.223.174] ([209.85.223.174:55370] helo=mail-ie0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 33/6A-22131-097A2125 for ; Mon, 19 Aug 2013 19:17:36 -0400 Received: by mail-ie0-f174.google.com with SMTP id x5so619763ieb.5 for ; Mon, 19 Aug 2013 16:17:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=GFHkiskcA9zi+bOzKpJTFSxRJrvuTauZf2w5yPtQOug=; b=Mk4Cod749HLP9qnIWsEWCV+7FF7Epjaphu9XjLCEpq87LcufUG7CxmhWp3Mbk2VXOd HY8RYbTu8xaOor+u6xDYxAtyv/ftPjUmLnXLMfjUUCfdijUwlbKi7KEOrh2vdLxmW214 tcmKUKbsXRLQ8K4vtFCtwe81Ck0ZmytEat5WudwNf+Qrn8MsnztT/3mhv3KkNiDfaihE 9vHqfdtuHGmXi5+Zy1qLsJXG9oHyWWaYPDUpnHCocTcgqqoRJayjzZBWCMu5C+lbvttB KOA+bgRXNYMdCQ/TpBBsz94zzbkTvlzziUOIqKtzIhp/FoKPzHeRCDV0IJxk+qme23L4 sjwA== MIME-Version: 1.0 X-Received: by 10.50.72.33 with SMTP id a1mr4531774igv.58.1376954253624; Mon, 19 Aug 2013 16:17:33 -0700 (PDT) Sender: jdavidlists@gmail.com Received: by 10.42.150.196 with HTTP; Mon, 19 Aug 2013 16:17:33 -0700 (PDT) In-Reply-To: References: Date: Mon, 19 Aug 2013 19:17:33 -0400 X-Google-Sender-Auth: SDQZxrT8l603V9rISjXc-RU94gg Message-ID: To: Michael Wallner Cc: Sara Golemon , PHP internals Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Interest in a "null" SAPI for embedding? From: j.david.lists@gmail.com (J David) On Mon, Aug 19, 2013 at 3:59 PM, Michael Wallner wrote: > I think it all was about to be as standalone as possible, e.g. you > could have a CLI with builtin readline/pcntl/whatelse extensions, > while mod_php could be kept lean of that and include an > opcache/whatelse instead. To stick with your example, of CLI and mod_php -- a good choice as it's likely the most common combo -- when linking to a common libphp5.so, the recommended methodology would be to build in only the functionality required by both, then load the rest as extensions from php-cli.ini or php.ini, respectively. This seems like the way it is generally done anyway? Is doing it this other way a thing that people actually do? > So, I'm not sure if a libphp.so is actually something we want > unconditionally... maybe if it wasn't --enable-null but something like > --enable-libphp, which would create a libphp.so which would be used > to link all of the specified SAPIs. That's essentially how I interpreted Sara's suggestion, with possibly some variance on whether or not this would be the default behavior. If the --enable-shared-phplib (or whatever) flag weren't present, the alternative would be to build a static library and then link your SAPI selections against that. The only difference in that scenario is that the static library could be (optionally and probably not by default) installed as libphp5.a to allow statically-linked independent SAPI's. That should produce default behavior almost indistinguishable from today. > Now that example actually points to a problem, what if I mix case 2 and 3= ? > ./configure --enable-libphp --enable-cli --disable-cgi ... > ./configure --enable-libphp --with-apxs ... > > Where "=85" could be f.e. enable-maintainer-zts or enable-debug? This concern (coexistence of conflicting settings/versions) seems very similar to this: On Mon, Aug 19, 2013 at 4:15 PM, Johannes Schl=FCter wrote: > For Unix I'm not sure it is good - it makes it complex to run multiple > PHP versions next to each other which is not only relevant for > developers but also hosters offering multiple versions. From the standpoint of major versions, versioning the library (e.g. libphp55.so, libphp-5.5.so) seems sensible. It doesn't seem reasonable to expect ABI/SPAI compatibility between branches. One could go as far as libphp55.so.2 for 5.5.2, though that might be overkill. Centrally installing one libphp55.so (e.g. into /usr/lib or /usr/local/lib) would still limit one to one set of build options, but as that is already largely true of centralized installations. Typically, php.ini needs to be different between development and production builds of the same version, for example. Or some/all of the extensions may need to be built with different settings, etc. However, in practice, this is not a problem we have encountered while running 5.3, 5.4, 5.5 and master alongside each other, often with multiple revisions within each major version and devel/debug vs. production variants of the same version. That's because we use a different --prefix for each. Then, to link to a specific build's libphp5.so created with null-sapi, we use the rpath flag at link time. This has proved to be a good strategy. However, we were doing this before we switched to this build methodology, because the speed bump of inter-version collisions had already been hit. :) In the worst case scenario, an additional flag like --with-shlib-suffix=3D55xyzpdq (producing/linking to libphp55xyzpdq.so) passed to PHP or SAPI builds would probably allow sufficiently infinite variety. :) Such an option would choose a sensible default ("55") for most people. Thanks!