Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 0E7F0200C00 for ; Wed, 18 Jan 2017 22:00:42 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 0D12F160B43; Wed, 18 Jan 2017 21:00:42 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 56CB3160B22 for ; Wed, 18 Jan 2017 22:00:41 +0100 (CET) Received: (qmail 12208 invoked by uid 500); 18 Jan 2017 21:00:40 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 12197 invoked by uid 99); 18 Jan 2017 21:00:40 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 18 Jan 2017 21:00:40 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id D969A1A06DA for ; Wed, 18 Jan 2017 21:00:39 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.651 X-Spam-Level: X-Spam-Status: No, score=0.651 tagged_above=-999 required=6.31 tests=[RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_NEUTRAL=0.652] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id kTltrEqv_AFG for ; Wed, 18 Jan 2017 21:00:35 +0000 (UTC) Received: from resqmta-po-02v.sys.comcast.net (resqmta-po-02v.sys.comcast.net [96.114.154.161]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 9B6F75F4AC for ; Wed, 18 Jan 2017 21:00:34 +0000 (UTC) Received: from resomta-po-06v.sys.comcast.net ([96.114.154.230]) by resqmta-po-02v.sys.comcast.net with SMTP id TxLNcGNQpoFDdTxLNcv8j2; Wed, 18 Jan 2017 21:00:33 +0000 Received: from [192.168.199.10] ([69.251.90.98]) by resomta-po-06v.sys.comcast.net with SMTP id TxLLca9OtpJ41TxLMcpo0g; Wed, 18 Jan 2017 21:00:33 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.2 \(3259\)) Subject: Re: Summary: Broken FastCGI with httpd From: Jim Jagielski In-Reply-To: <8d174737-ae1a-34d7-dc89-a8393f91be37@gmail.com> Date: Wed, 18 Jan 2017 16:00:31 -0500 Cc: David Zuelke Content-Transfer-Encoding: quoted-printable Message-Id: References: <9335c87a-ff39-5c0d-4d82-ba239b6e0248@gmail.com> <68B8CB99-D049-4C9D-80FC-A9BD24FAF37C@greenbytes.de> <6699836C-96A0-45AD-90A7-AF0894CB7F26@jaguNET.com> <8d174737-ae1a-34d7-dc89-a8393f91be37@gmail.com> To: httpd X-Mailer: Apple Mail (2.3259) X-CMAE-Envelope: MS4wfOLhzjd+6UgRrK9nKvOJ8DAWQXxlWDK8vNr3tqTtmH+gptj4k8Lo/gZUTQqVO8KKhdR5PpHm+5ycz9B2Ip+PkDj3VAeipb8GbapkQQ+DEvcNnlwmaE+B cDHijT6eV1mSdd0Ei8JS0tE5+qSWArCu8rh0qk+zUaIXH0sdu6gyb2NKgY8XXidj8vdWRfezvuvTJA== archived-at: Wed, 18 Jan 2017 21:00:42 -0000 The thing is that when we are proxying back, some of those values can't make sense, since, for example, there is no "real" path on the httpd server that maps to the actual request file.... I think the original idea was to simply send the full URL to the FCGI server, to let it parse things out for itself... After all, it's easier for the FCGI server to know the SCRIPT_NAME than httpd to "guess"... This was, iirc, the initial concept related to how to leverage SCRIPT_FILENAME on the PHP side. What we need is some specific understanding between, in this case, PHP-FPM and httpd on what it wants/expects/needs regarding these env-vars. Yeah, SCRIPT_FILENAME seems core to this, I think. > On Jan 18, 2017, at 2:01 PM, Jacob Champion = wrote: >=20 > On 01/18/2017 06:43 AM, Jim Jagielski wrote: >> Also, the fact that different methods of invoking FCGI result >> in different vars, at 1st blush, doesn't seem "incorrect" >> assuming that each difference makes some sense, in a way. >=20 > They don't make sense. For example, mod_proxy_fcgi can be set up in a = way that mirrors the mod_fastcgi preferred configuration, using an = Action: >=20 > AddType application/x-php7-fpm .php > Action application/x-php7-fpm /php7-fpm virtual > > SetHandler proxy:fcgi://localhost:9000 > >=20 > This results in the following variables when I access the URL = '/hello.php/path/info?query': >=20 > SCRIPT_FILENAME: /var/www/php7-fpm > SCRIPT_NAME: /php7-fpm > PATH_INFO: /hello.php/path/info > PATH_TRANSLATED: /var/www/hello.php/path/info > QUERY_STRING: query >=20 > We only get QUERY_STRING right. (Well, I won't say SCRIPT_FILENAME is = "wrong", since there is no standard definition, but it's not helpful.) = SCRIPT_NAME is supposed to point to a possible script-path (see RFC 3875 = for definitions), '/hello.php' in this instance. PATH_INFO and = PATH_TRANSLATED should not include 'hello.php' in their values. That is because we have no idea what SCRIPT_NAME is... With the "guess" = that it is /php7-fpm, then PATH_INFO kind of makes sense, since it is the portion of the URI following the script. And considering that we use Action application/x-php7-fpm /php7-fpm virtual the 2nd parameter is specifically noted as *being the cgi-script* and so of course httpd assumes that /php7-fpm is SCRIPT_NAME, because we explicitly called it that :) >=20 > It's not just Action. PR 51517 contains examples using ProxyPassMatch. >=20 > --Jacob