Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:58013 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20662 invoked from network); 24 Feb 2012 20:09:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Feb 2012 20:09:01 -0000 Authentication-Results: pb1.pair.com smtp.mail=kris.craig@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=kris.craig@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.54 as permitted sender) X-PHP-List-Original-Sender: kris.craig@gmail.com X-Host-Fingerprint: 74.125.82.54 mail-ww0-f54.google.com Received: from [74.125.82.54] ([74.125.82.54:46235] helo=mail-ww0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E5/66-17132-C5EE74F4 for ; Fri, 24 Feb 2012 15:09:00 -0500 Received: by wgbdq12 with SMTP id dq12so2278854wgb.11 for ; Fri, 24 Feb 2012 12:08:57 -0800 (PST) Received-SPF: pass (google.com: domain of kris.craig@gmail.com designates 10.180.80.40 as permitted sender) client-ip=10.180.80.40; Authentication-Results: mr.google.com; spf=pass (google.com: domain of kris.craig@gmail.com designates 10.180.80.40 as permitted sender) smtp.mail=kris.craig@gmail.com; dkim=pass header.i=kris.craig@gmail.com Received: from mr.google.com ([10.180.80.40]) by 10.180.80.40 with SMTP id o8mr7541216wix.10.1330114137304 (num_hops = 1); Fri, 24 Feb 2012 12:08:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=plaDSy0v4Rhxl0fDqSr0oJZxwEnWMMqhvGF4t6mqhQ8=; b=yAe5xoD6ZsJYEqYaMjpBSzuBwStpK68mjr1Oc6QLDFw6v5iI5aQJuyC5e00C9o3rxS iLxXqJ5lQORPugDtycE4HCfG24N+mkab5Y+tOq01jWgorvMLTkd7B/C2BiZTjr7OGuZm /05S9rIw1t1P5wJlbZ6ViYfnzRQIt1X0Yy71c= MIME-Version: 1.0 Received: by 10.180.80.40 with SMTP id o8mr6054539wix.10.1330114137204; Fri, 24 Feb 2012 12:08:57 -0800 (PST) Received: by 10.223.75.146 with HTTP; Fri, 24 Feb 2012 12:08:57 -0800 (PST) In-Reply-To: References: Date: Fri, 24 Feb 2012 12:08:57 -0800 Message-ID: To: Tom Boutell Cc: PHP Internals Content-Type: multipart/alternative; boundary=f46d04428b8ea8a7ee04b9bb548f Subject: Re: [PHP-DEV] pecl, zts, non-zts, fastcgi and Apache From: kris.craig@gmail.com (Kris Craig) --f46d04428b8ea8a7ee04b9bb548f Content-Type: text/plain; charset=ISO-8859-1 As far as Windows is concerned, it is worth noting that the Apache mod_php (i.e. ZTS) build is supported. Also, though my information is a bit outdated, last I heard work was being done to support thread-safe PHP as an ISAPI module on IIS, though I don't know what the status of that is. --Kris On Fri, Feb 24, 2012 at 11:52 AM, Tom Boutell wrote: > I'm building a script that installs PHP 5.3.10 from source. One of the > steps is to install apc and mongo support via pecl. I'm building the > CGI/FastCGI version. This is on a box that formerly had mod_php > installed. > > If I do 'make install' of PHP (which installs a new pecl binary) and > follow it up immediately with 'pecl install apc', the apc extension > winds up here: > > /usr/local/lib/php/extensions/no-debug-zts-20090626 > > That's not what command line php and php-cgi are looking for, so they > produce warnings and don't load the extensions. > > However If I do the pecl install later - possibly after restarting > Apache with fastcgi enabled - it installs to the new, correct place: > > no-debug-non-zts-20090626 > > The warnings go away, and everything is great. > > This raises two questions about which no documentation seems to exist > after quite a bit of searching and which raise questions about whether > PHP is doing sensible things, so I took the liberty of bringing them > to folks who actually understand PHP's internals. > > 1. You only get one pecl binary although you may have many SAPIs > installed. mod_php defaults to thread-safe (and there seems to be no > way to turn that off on Linux), while php-cgi does not. So how does > pecl decide which way to build extensions? I tried setting > extensions_dir via config-set, but that setting was ignored (unless > perhaps it falls back if the folder doesn't exist yet?). How can I > ensure that, having just installed PHP and pecl, my next pecl install > will build extensions for the right flavor of PHP? > > 2. Why does php turn on thread-safety for mod_php at all on Linux, > given that it apparently still doesn't work very well with various > extensions in a genuinely multithreaded situation, slows things down, > takes more memory, and leads to problems like this one? > > Everyone I've found runs PHP under the Apache prefork MPM, which does > not attempt to run PHP in multiple threads of one process. I have > never seen anyone successfully use the worker MPM with PHP, except by > moving PHP out to a fastcgi process pool, which is, again, > single-process PHP. > > Even Microsoft's PHP accelerator uses the fastcgi-based, > one-process-per-PHP-request approach. Since Windows is so > thread-oriented that seems significant. > > I have attached my script. > > Thanks for any insight! > > On Sun, Feb 5, 2012 at 9:59 AM, Nikita Popov > wrote: > > Hi internals! > > > > I have written an RFC that proposes to *deprecate* and *remove* the /e > modifier: > > > > https://wiki.php.net/rfc/remove_preg_replace_eval_modifier > > > > Comments welcome! > > > > -- > > PHP Internals - PHP Runtime Development Mailing List > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > -- > Tom Boutell > P'unk Avenue > 215 755 1330 > punkave.com > window.punkave.com > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > --f46d04428b8ea8a7ee04b9bb548f--