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 4D860200C5B for ; Thu, 13 Apr 2017 04:24:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 4C15F160BA8; Thu, 13 Apr 2017 02:24:14 +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 6C4E3160B95 for ; Thu, 13 Apr 2017 04:24:13 +0200 (CEST) Received: (qmail 68832 invoked by uid 500); 13 Apr 2017 02:24:12 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 68820 invoked by uid 99); 13 Apr 2017 02:24:12 -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; Thu, 13 Apr 2017 02:24:12 +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 B47771A00FB for ; Thu, 13 Apr 2017 02:24:11 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.024 X-Spam-Level: X-Spam-Status: No, score=-1.024 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-2.796, SPF_SOFTFAIL=0.972] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id iSftOzQfFv9v for ; Thu, 13 Apr 2017 02:24:10 +0000 (UTC) Received: from smtp93.iad3a.emailsrvr.com (smtp93.iad3a.emailsrvr.com [173.203.187.93]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 23CDC5FC4A for ; Thu, 13 Apr 2017 02:24:10 +0000 (UTC) Received: from smtp12.relay.iad3a.emailsrvr.com (localhost [127.0.0.1]) by smtp12.relay.iad3a.emailsrvr.com (SMTP Server) with ESMTP id 0F7C325186 for ; Wed, 12 Apr 2017 22:24:04 -0400 (EDT) X-Auth-ID: frank@ccds.ca Received: by smtp12.relay.iad3a.emailsrvr.com (Authenticated sender: frank-AT-ccds.ca) with ESMTPSA id EBC6F25018 for ; Wed, 12 Apr 2017 22:24:03 -0400 (EDT) X-Sender-Id: frank@ccds.ca Received: from [192.168.0.101] ([UNAVAILABLE]. [192.252.134.234]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA) by 0.0.0.0:587 (trex/5.7.12); Wed, 12 Apr 2017 22:24:04 -0400 To: users@httpd.apache.org References: <201704121734.42135.john.iliffe@iliffe.ca> <201704122036.17496.john.iliffe@iliffe.ca> From: Frank Message-ID: <1577ac88-f9a8-fc0e-89f0-a5e4e5007de6@apache.org> Date: Wed, 12 Apr 2017 22:24:03 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <201704122036.17496.john.iliffe@iliffe.ca> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [users@httpd] unable to execute php-fpm properly archived-at: Thu, 13 Apr 2017 02:24:14 -0000 On 12/04/17 08:36 PM, John Iliffe wrote: > See below. > > On Wednesday 12 April 2017 20:02:10 Frank wrote: >> On 12/04/17 05:34 PM, John Iliffe wrote: >>> I am converting my web pages from mod_php to php-fpm, following the >>> directions found at: https://wiki.apache.org/httpd/PHP-FPM Testing >>> to date indicates that on this server all scripts work properly under >>> mod_php. >>> >>> Both of the following were tried within a container for >>> the default virtual host. >>> >>> If I use the "simple" approach from the Wiki: >>> ProxyPass "/*.php/" "fcgi://127.0.0.1:9000" enablereuse=on >>> >>> then the page SOURCE is displayed, PHP never executes. Adding a first >>> line of #! /path-to-php-executable doesn't accomplish >>> anything. Neither way leads to any errors showing in the php-fpm >>> log. >>> >>> >>> Using the "more flexible" approach: >>> >>> ProxyPassMatch ^/(.*\.php(/.*)?)$ >>> fcgi://127.0.0.1:9000/httpd/iliffe/$1 >>> >>> enablereuse=on >>> >>> Gives me a "No Input File Specified" error. This line was cribbed >>> from the Wiki example and the path /httpd/iliffe/ is precisely where >>> the php script lives, based on the server root and not the document >>> root as noted in the Wiki article. >>> >>> There is no php-fpm error message issued in either case and the Apache >>> error entry for the ProxyPassMatch case is: >>> >>> [Wed Apr 12 16:50:28.688837 2017] [proxy_fcgi:error] [pid 13574:tid >>> 140145512003328] [client 192.168.1.10:45240] AH01071: Got error >>> 'Unable to open primary script: /httpd/iliffe/testfcgi.php (No such >>> file or directory)\n' >>> >>> I am using mostly the defaults in the php-fpm config and pool config >>> files. The default path to the php executable has been updated to >>> point to where it really is. >>> >>> Can anybody see what I might have missed? >>> >>> Thanks in advance. >>> >>> John >>> ========================================= >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org >>> For additional commands, e-mail: users-help@httpd.apache.org >> >> 1) ProxyPass doesn't use PCRE (the wiki does not use PCRE with >> ProxyPass, either). You need to use ProxyPassMatch to parse PCRE. > > I'm not sure what you are saying here. When I used only ProxyPass using > the default configuration in the Wiki, the correct page was displayed, it > just didn't execute the PHP script and adding the bang-path didn't change > anything. The source code was displayed as the page. > > While it is possible that the ProxyPath directive didn't match anything and > Apache tried to handle the script file as a static page, I have been unable > to prove that conjecture. The page IS in Apache's document root for this > virtual host, so I suppose that is possible. There is no SetHandler > directive to handle the .php extension, and my understanding of the > documentation is that one should not be required since Apache is not > actually running the script. >> >> 2) /httpd/iliffe/testfcgi.php would need to exist on your filesystem or >> php-fpm chroot. The requested URI is literally appended to the path in >> the ProxyPassMatch directive. > > Yes, that's what I had expected to happen. php-fpm does not chroot; the > true path /httpd/iliffe/testfcgi.php exists in the file system and is visible > to php-fpm, based on the simpler configuration. That's what's so weird, the > same path gets completely different results, depending on the way the script > is called. In this case the $1 amounts to a null since there is no passed > data in the URL. > > Before you ask, I expect SELinux problems with these files because of the > tagging, but at the moment SELinux is in permissive mode. > > John >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org >> For additional commands, e-mail: users-help@httpd.apache.org > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org > For additional commands, e-mail: users-help@httpd.apache.org > ProxyPass *cannot* understand PCRE. ProxyPassMatch *can*. Hence, do *not* use PCRE with ProxyPass. That is all. Step 1) Make sure that mod_proxy_fcgi is loaded. See apachectl -M As for the "Primary Script Unknown" error, it always means that you mapped the request to a non-existent resource on the file system / chroot. Verify again. The various methods listed on the wiki allow httpd to pass the request to a fcgi backend, which will process the php file, and return the output. You can use the SetHandler approach instead of ProxyPassMatch - it's up to you. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org