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 26F80200C76 for ; Sat, 13 May 2017 21:33:13 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 259DA160BBB; Sat, 13 May 2017 19:33:13 +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 C1F54160BB2 for ; Sat, 13 May 2017 21:33:11 +0200 (CEST) Received: (qmail 89850 invoked by uid 500); 13 May 2017 19:33:10 -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 89839 invoked by uid 99); 13 May 2017 19:33:10 -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; Sat, 13 May 2017 19:33:10 +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 0B99D1A7A5C for ; Sat, 13 May 2017 19:33:10 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2 X-Spam-Level: ** X-Spam-Status: No, score=2 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=2] 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 Bj6hg1zvf9sp for ; Sat, 13 May 2017 19:33:07 +0000 (UTC) Received: from iliffe.ca (coaxpublications.ca [206.248.138.118]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 9FF4B5FC57 for ; Sat, 13 May 2017 19:33:06 +0000 (UTC) X-Default-Received-SPF: pass (skip=loggedin (res=PASS)) x-ip-name=192.168.1.10; Received: from wkstn01.iliffe.ca (unverified [192.168.1.10]) by iliffe.ca (SurgeMail 7.2i) with ESMTP (TLS) id 154-1327802 for ; Sat, 13 May 2017 15:32:57 -0400 From: John Iliffe To: users@httpd.apache.org Date: Sat, 13 May 2017 15:43:08 -0400 User-Agent: KMail/1.13.3 (Linux/2.6.33.7-desktop-2mnb; KDE/4.4.3; x86_64; ; ) X-KMail-Markup: true MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="Boundary-01=_MH2FZnRwFVjuDOl" Content-Transfer-Encoding: 7bit Message-Id: <201705131543.08706.john.iliffe@iliffe.ca> X-Authenticated-User: john.iliffe@iliffe.ca Subject: [users@httpd] Getting PHP-FPM working archived-at: Sat, 13 May 2017 19:33:13 -0000 --Boundary-01=_MH2FZnRwFVjuDOl Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit I'm not sure is this is the correct list to post these questions to, since I now have things isolated to a single module in PHP-FPM, so please redirect me if necessary. This is a continuation of the problems I was having (on this list) installing a new server last month. --------------------- Summary: PHP-FPM will not execute any scripts; it is set up according to the PHP-FPM Wiki documentation so far as I can see. --------------------- O/S Fedora 25, Apache 2.4.25 compiled from source, PHP 7.1.3 compiled from source. I did a clean install of PHP-7.1.3 for testing, PHP-FPM is running under its own user/group phpfpm. Set up as listen on 127.0.0.1:9015 in pool www. Document root in www.conf is /httpd/iliffe which has been set to world readable, SELinux is set to permissive so it isn't in the equation. Log level on PHP is debug. All available log info is at the end of this memo. It seems obvious to me that the proxy_fcgi module is worked as expected and that the problem is somewhere in PHP-FPM. mod_php was tried as a check on the installation and works OK when enabled. I am using the minimalist proxy configuration in Apache, (the target PHP script is hard coded to avoid regex errors) and the target PHP script file is being reported correctly by both Apache and PHP-FPM. I checked by su as the phpfpm user and I can read this file, no problems at all. The problem has been traced to fpm_main.c, specifically the following: ----------------------------- if (UNEXPECTED(php_fopen_primary_script(&file_handle) == FAILURE)) { zend_try { zlog(ZLOG_ERROR, "Unable to open primary script: %s (%s)", primary_script, strerror(errno)); if (errno == EACCES) { SG(sapi_headers).http_response_code = 403; PUTS("Access denied.\n"); } else { SG(sapi_headers).http_response_code = 404; PUTS("No input file specified.\n"); -------------------------------- Changing the script path in httpd.conf leads to a browser File Not Found error as would be expected. The document root in httpd.conf and in www.conf (PHP pool conf file for this pool) are the same. In Apache, the minimum is set in httpd.conf: # Default host (www.iliffe.ca) # This one picks up all IP based hacker garbage too ServerName www.iliffe.ca DocumentRoot /httpd/iliffe Options FollowSymLinks H2Direct on # ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9015/httpd/iliffe/$1 ProxyPassMatch ^/info$ fcgi://127.0.0.1:9015/httpd/iliffe/i_phpinfo.php As far as I can see, all necessary Apache modules are loaded: # /usr/apache-2.4.25/bin/httpd -M Loaded Modules: core_module (static) so_module (static) http_module (static) **** big list of modules skipped here**** proxy_module (shared) proxy_connect_module (shared) proxy_http_module (shared) proxy_fcgi_module (shared) ssl_module (shared) unixd_module (shared) http2_module (shared) status_module (shared) ******more modules skipped here**** I'm completely stuck here and any ideas or assistance would be appreciated. Regards, John All following errors from one screen access: ------------------------- PHP-FPM log: [13-May-2017 14:40:33.423449] DEBUG: pid 16444, fpm_pctl_perform_idle_server_maintenance(), line 379: [pool www] currently 0 active children, 2 spare children, 2 running children. Spawning rate 1 [13-May-2017 14:40:34.265891] WARNING: pid 16444, fpm_stdio_child_said(), line 197: [pool www] child 16445 said into stderr: "ERROR: main(), line 1947: Unable to open primary script: /httpd/iliffe/i_phpinfo.php (No such file or directory)" [13-May-2017 14:40:34.265952] DEBUG: pid 16444, fpm_event_loop(), line 419: event module triggered 1 events [13-May-2017 14:40:34.424195] DEBUG: pid 16444, fpm_pctl_perform_idle_server_maintenance(), line 379: [pool www] currently 0 active children, 2 spare children, 2 running children. Spawning rate 1 ---------------------------- Apache Access Log: 206.248.138.118 - - [13/May/2017:14:40:34 -0400] "GET /info HTTP/1.1" 404 25 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0" ------------------------------ Apache Error Log: [Sat May 13 14:40:34.266066 2017] [proxy_fcgi:error] [pid 16122:tid 140525759854336] [client 206.248.138.118:57270] AH01071: Got error 'Unable to open primary script: /httpd/iliffe/i_phpinfo.php (No such file or directory)\n' ------------------------------- Browser Screen Error: No input file specified. -------------------------------- --Boundary-01=_MH2FZnRwFVjuDOl Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: 7bit

I'm not sure is this is the correct list to post these questions to, since I now have things isolated to a single module in PHP-FPM, so please redirect me if necessary. This is a continuation of the problems I was having (on this list) installing a new server last month.

---------------------

Summary: PHP-FPM will not execute any scripts; it is set up according to the PHP-FPM Wiki documentation so far as I can see.

---------------------

O/S Fedora 25, Apache 2.4.25 compiled from source, PHP 7.1.3 compiled from source.

I did a clean install of PHP-7.1.3 for testing, PHP-FPM is running under its own user/group phpfpm. Set up as listen on 127.0.0.1:9015 in pool www. Document root in www.conf is /httpd/iliffe which has been set to world readable, SELinux is set to permissive so it isn't in the equation. Log level on PHP is debug. All available log info is at the end of this memo.

It seems obvious to me that the proxy_fcgi module is worked as expected and that the problem is somewhere in PHP-FPM.

mod_php was tried as a check on the installation and works OK when enabled.

I am using the minimalist proxy configuration in Apache, (the target PHP script is hard coded to avoid regex errors) and the target PHP script file is being reported correctly by both Apache and PHP-FPM. I checked by su as the phpfpm user and I can read this file, no problems at all.

The problem has been traced to fpm_main.c, specifically the following:

-----------------------------

if (UNEXPECTED(php_fopen_primary_script(&file_handle) == FAILURE)) {

		zend_try {
			zlog(ZLOG_ERROR, "Unable to open primary script: %s (%s)", primary_script, strerror(errno));
			if (errno == EACCES) {
				SG(sapi_headers).http_response_code = 403;
				PUTS("Access denied.\n");
			} else {
				SG(sapi_headers).http_response_code = 404;
				PUTS("No input file specified.\n");

--------------------------------

Changing the script path in httpd.conf leads to a browser File Not Found error as would be expected. The document root in httpd.conf and in www.conf (PHP pool conf file for this pool) are the same.

In Apache, the minimum is set in httpd.conf:

# Default host (www.iliffe.ca)

# This one picks up all IP based hacker garbage too

<VirtualHost *:80>

ServerName www.iliffe.ca

DocumentRoot /httpd/iliffe

Options FollowSymLinks

H2Direct on

# ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9015/httpd/iliffe/$1

ProxyPassMatch ^/info$ fcgi://127.0.0.1:9015/httpd/iliffe/i_phpinfo.php

As far as I can see, all necessary Apache modules are loaded:

# /usr/apache-2.4.25/bin/httpd -M

Loaded Modules:

core_module (static)

so_module (static)

http_module (static)

**** big list of modules skipped here****

proxy_module (shared)

proxy_connect_module (shared)

proxy_http_module (shared)

proxy_fcgi_module (shared)

ssl_module (shared)

unixd_module (shared)

http2_module (shared)

status_module (shared)

******more modules skipped here****

I'm completely stuck here and any ideas or assistance would be appreciated.

Regards,

John

All following errors from one screen access:

-------------------------

PHP-FPM log:

[13-May-2017 14:40:33.423449] DEBUG: pid 16444, fpm_pctl_perform_idle_server_maintenance(), line 379: [pool www] currently 0 active children, 2 spare children, 2 running children. Spawning rate 1

[13-May-2017 14:40:34.265891] WARNING: pid 16444, fpm_stdio_child_said(), line 197: [pool www] child 16445 said into stderr: "ERROR: main(), line 1947: Unable to open primary script: /httpd/iliffe/i_phpinfo.php (No such file or directory)"

[13-May-2017 14:40:34.265952] DEBUG: pid 16444, fpm_event_loop(), line 419: event module triggered 1 events

[13-May-2017 14:40:34.424195] DEBUG: pid 16444, fpm_pctl_perform_idle_server_maintenance(), line 379: [pool www] currently 0 active children, 2 spare children, 2 running children. Spawning rate 1

----------------------------

Apache Access Log:

206.248.138.118 - - [13/May/2017:14:40:34 -0400] "GET /info HTTP/1.1" 404 25 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0"

------------------------------

Apache Error Log:

[Sat May 13 14:40:34.266066 2017] [proxy_fcgi:error] [pid 16122:tid 140525759854336] [client 206.248.138.118:57270] AH01071: Got error 'Unable to open primary script: /httpd/iliffe/i_phpinfo.php (No such file or directory)\n'

-------------------------------

Browser Screen Error:

No input file specified.

--------------------------------

--Boundary-01=_MH2FZnRwFVjuDOl--