Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:74896 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30327 invoked from network); 14 Jun 2014 04:58:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jun 2014 04:58:37 -0000 Authentication-Results: pb1.pair.com smtp.mail=davidkmuir@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=davidkmuir@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.160.49 as permitted sender) X-PHP-List-Original-Sender: davidkmuir@gmail.com X-Host-Fingerprint: 209.85.160.49 mail-pb0-f49.google.com Received: from [209.85.160.49] ([209.85.160.49:54293] helo=mail-pb0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 92/B3-03909-C76DB935 for ; Sat, 14 Jun 2014 00:58:36 -0400 Received: by mail-pb0-f49.google.com with SMTP id jt11so2723460pbb.8 for ; Fri, 13 Jun 2014 21:58:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=7l1XARpveG1BLFUceB42DQBDe1oiooFP3GD24R9OzVI=; b=QZGGYthbvESDRYXnrDLaZP7w+RDC1N6GBvYJBoB5gmCU3HsqVSHp6jelgA07lWKYt8 vhh7tkq0FE8FbA1EvFGTLgwgqc7hoa7tc5qJZRVZcYfqe9+rgtq9i8Ey0dlVPKzbnZIU 7FaYfa5BINfSlYFS+qQfKfFm4GdmfdzD9HkgATY0JKit+uf/ihiU+ps3V2io9SdWsGpo smB722g09GMJ6nsWnc8UNFJ3TAmk7Uh/WTbse7d7IbM97BQ8b1SAp75GKPQ154UaQj1U Tuc+fJNWY557OHptwGdUxkDmou9cky9bF5mBXPvC8jQqluqC7x+3cRN85KKO2ul/zOCB m03w== X-Received: by 10.68.194.134 with SMTP id hw6mr8346660pbc.49.1402721913544; Fri, 13 Jun 2014 21:58:33 -0700 (PDT) Received: from [192.168.0.3] (115-64-165-88.static.tpgi.com.au. [115.64.165.88]) by mx.google.com with ESMTPSA id yv7sm31332112pac.33.2014.06.13.21.58.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Jun 2014 21:58:32 -0700 (PDT) Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Content-Type: text/plain; charset=windows-1252 X-Priority: 1 In-Reply-To: <035C7115-6871-4FC6-802E-464FD48070EF@heroku.com> Date: Sat, 14 Jun 2014 14:57:55 +1000 Cc: PHP internals , Ilia Alshanetsky , Julien Pauli Content-Transfer-Encoding: quoted-printable Message-ID: <7E8C4348-EFCC-491E-9B0B-1B61B87635B9@gmail.com> References: <035C7115-6871-4FC6-802E-464FD48070EF@heroku.com> To: David Zuelke X-Mailer: Apple Mail (2.1878.2) Subject: Re: [PHP-DEV] Fixing (and making easier) Apache mod_proxy_fcgi with PHP-FPM From: davidkmuir@gmail.com (David Muir) On 13 Jun 2014, at 5:47 am, David Zuelke wrote: > Hi everyone (already discussed this a bit off-list with Julien), >=20 > Ilia and I sat down last week at International PHP Conference to = discuss https://bugs.php.net/bug.php?id=3D65641. >=20 > This is a pretty critical issue with Apache 2.4, since it leads to an = incorrect SCRIPT_NAME (and thus also PHP_SELF) value if PATH_INFO is = given, and frameworks such as CodeIgniter (I know=85) break under these = circumstances. Ilia has remarked that the emalloc() that never gets = free()d might not be ideal with debug on, but it's hard to do in this = case, so not sure how critical the patch is. It may need some comments = though explaining that if SCRIPT_NAME contains PATH_INFO, the latter is = stripped from it again. >=20 > More importantly: >=20 > We also looked at a related thing together: support for a new way of = proxying requests to PHP-FPM in Apache trunk (and the feature will now = be backported to Apache 2.4.x, so it'll be in the next release). >=20 > This is *very* big news for PHP-FPM, because the current two options = for using mod_proxy_fcgi (which is the future-proof way of connecting = Apache and FPM) are both far from ideal: >=20 > 1) ProxyPassMatch: skips all .htaccess rewrites etc > 2) Default mod_rewrite rules on VirtualHost level: will always have to = take precedence over certain user-land rewrites, so there's always = conflicts, redirect loops and so forth (I've tried, it's messy). >=20 > The new approach, which can also be built as a standalone module for = older versions of Apache = (https://gist.github.com/progandy/6ed4eeea60f6277c3e39), works like = this: >=20 > > SetHandler proxy:fcgi://localhost:9000 > >=20 > It's very simple, and very similar to how mod_php is used in Apache, = so that'll make it very easy and convenient for users to use FPM with = Apache 2.4.10+ This sounds great! And I see in the comments on github that it works = with unix sockets too! I just wasted several hours trying to get my = user-land rewrites working... I had to swap to using a RewriteRule = instead of ProxyPassMatch, but I could not get it working with a unix = socket. In the end I had to reconfigure FPM to listen to a tcp socket = instead. Very annoying, but I=92m very happy to see a much simpler and = cleaner solution just around the corner! Hopefully I=92ll actually be = able to start using 5.5 in production soon.=20 Cheers, David=