Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:58008 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 13484 invoked from network); 24 Feb 2012 19:52:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Feb 2012 19:52:38 -0000 Authentication-Results: pb1.pair.com smtp.mail=tom@punkave.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tom@punkave.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain punkave.com designates 209.85.215.42 as permitted sender) X-PHP-List-Original-Sender: tom@punkave.com X-Host-Fingerprint: 209.85.215.42 mail-lpp01m010-f42.google.com Received: from [209.85.215.42] ([209.85.215.42:53413] helo=mail-lpp01m010-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 43/E4-17132-48AE74F4 for ; Fri, 24 Feb 2012 14:52:37 -0500 Received: by lagk11 with SMTP id k11so3430517lag.29 for ; Fri, 24 Feb 2012 11:52:34 -0800 (PST) Received-SPF: pass (google.com: domain of tom@punkave.com designates 10.112.101.40 as permitted sender) client-ip=10.112.101.40; Authentication-Results: mr.google.com; spf=pass (google.com: domain of tom@punkave.com designates 10.112.101.40 as permitted sender) smtp.mail=tom@punkave.com Received: from mr.google.com ([10.112.101.40]) by 10.112.101.40 with SMTP id fd8mr1507249lbb.17.1330113154006 (num_hops = 1); Fri, 24 Feb 2012 11:52:34 -0800 (PST) MIME-Version: 1.0 Received: by 10.112.101.40 with SMTP id fd8mr1236271lbb.17.1330113153879; Fri, 24 Feb 2012 11:52:33 -0800 (PST) Received: by 10.152.6.136 with HTTP; Fri, 24 Feb 2012 11:52:33 -0800 (PST) Date: Fri, 24 Feb 2012 14:52:33 -0500 Message-ID: To: PHP Internals Content-Type: multipart/mixed; boundary=f46d0401687f0c4e0f04b9bb1a5b X-Gm-Message-State: ALoCoQnA6CK+vzA2thhjPRfxohqXgl1e9gs1GMGuLdqKerHjkFqgRtdNJuT0W0TElwOHfq+ER7K5 Subject: pecl, zts, non-zts, fastcgi and Apache From: tom@punkave.com (Tom Boutell) --f46d0401687f0c4e0f04b9bb1a5b Content-Type: text/plain; charset=ISO-8859-1 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 --f46d0401687f0c4e0f04b9bb1a5b Content-Type: application/x-sh; name="update-php.sh" Content-Disposition: attachment; filename="update-php.sh" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gz1mwvqj0 IyEvYmluL3NoCgojIFRISVMgV0lMTCBJTlNUQUxMIFRIRSBTUEVDSUZJRUQgVkVSU0lPTiBPRiBQ SFAKIyBUTyAvdXNyL2xvY2FsL2JpbiwgZXRjLiBZT1UgV0lMTCBHRVQgVEhFIENHSS9GQVNUQ0dJ CiMgQU5EIENPTU1BTkQgTElORSBCSU5BUklFUy4gWU9VIFdJTEwgKk5PVCogR0VUIG1vZF9waHAs CiMgU08gTUFLRSBTVVJFIFlPVSBGT0xMT1cgCiMgaHR0cDovL3B1bmthdmUuY29tL3dpbmRvdy8y MDEwLzAzLzA4L2Zhc3Rlci1waHAta2lsbC1raWxsCiMgQUZURVIgVEhJUwoKVkVSU0lPTj0kMQoK VVNBR0U9IlVzYWdlOiB1cGRhdGUtcGhwLnNoIFt2ZXJzaW9uXSIKCmlmIFsgLXogIiQxIiBdIDsg dGhlbgogIGVjaG8gJFVTQUdFCiAgZXhpdCAxCmZpCgpybSAtZiBwaHAtJFZFUlNJT04udGFyLmd6 ICYmCndnZXQgLS10cnVzdC1zZXJ2ZXItbmFtZXMgaHR0cDovL3VzMy5waHAubmV0L2dldC9waHAt JFZFUlNJT04udGFyLmd6L2Zyb20vdXMucGhwLm5ldC9taXJyb3IgJiYKdGFyIC16eGYgcGhwLSRW RVJTSU9OLnRhci5neiAmJgpjZCBwaHAtJFZFUlNJT04gJiYKIyBtb2RfcGhwIGZvciBBcGFjaGUg aWYgd2UgY2hvb3NlIHRvIHVzZSBpdC4gQWxzbyBpbnN0YWxscyBDTEkKIyBBQ0hUVU5HOiBEb2Vz IE5PVCBwbGF5IG5pY2Ugd2l0aCBmYXN0Y2dpL2NnaSBv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