Web lists-archives.com

Re: [PHP] PHP-FPM fails to start scripts

On Tuesday 23 May 2017 02:40:03 Lester Caine wrote:
> On 23/05/17 02:41, John Iliffe wrote:
> > The Apache directive invoking this script is:
> > 	ProxyPassMatch "^/.*\.php(/.*)?$" fcgi://
> ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://$1
> was your original line, and this should have resulted in the right
> trimming of slashes while I think you are currently getting the double
> slash because of the trailing one in your current string.
> ProxyPassMatch ^/info$ fcgi://
> and http://localhost/info should work ... but is /httpd REALLY a root
> folder? I'm getting /srv/www/htdocs as the default root, and I switch to
> /srv/website/test.com for each website ...
> I'm still running Apache2.4 with mod_php5.so as I was having a similar
> problem 'converting'. I've got nginx running php-fpm and even different
> versions which I can pick up, but I could do with having another go with
> the old Apache machines if only to allow PHP7 to run with the PHP5 setup
> ;)
Thanks Lester.

Now that was interesting.  My original line didn't have the $1 on the end 
of the match, so I added it.  Now I get "File Not Found" as a browser 
response and the trace doesn't show all those lstats.  Only one now and it 
is a stat (not lstat).

3156  12:41:52 stat("/httpd/iliffe", {st_mode=S_IFDIR|0755, st_size=4096, 
...}) = 0

Note that the requested script is no longer there.  It still gets the 
correct path from somewhere.  The log entries are:

[23-May-2017 12:42:16] ERROR: unable to read what child say: Bad file 
descriptor (9)
[23-May-2017 12:42:16] ERROR: unable to read what child say: Bad file 
descriptor (9)

httpd log
[Tue May 23 12:43:15.441179 2017] [proxy:error] [pid 2980:tid 
140444876887808] (111)Connection refused: AH00957: FCGI: attempt to connect 
to (*) failed
[Tue May 23 12:43:15.441237 2017] [proxy_fcgi:error] [pid 2980:tid 
140444876887808] [client] AH01079: failed to make 
connection to backend:
[Tue May 23 12:43:18.797290 2017] [proxy_fcgi:error] [pid 2981:tid 
140444935636736] [client] AH01071: Got error 'Primary 
script unknown\n'

ss -a shows socket is active:
tcp    LISTEN     0      128                  *:*                    
tcp    LISTEN     0      0                  *:* 

Any other ideas?  

FYI, buried in the php-fpm source code there are a number of comments about 
the problem of getting the correct directory path from Apache calls.  Looks 
like the PHP folks haven't solved the problem for PHP 7 yet.  While I was 
Googling this problem I noticed piles of reports of problems with nginx 
running php-fpm so maybe they resolved that first.  One other point is the 
big section in the man pages for lstat for Fedora 25 showing changes in the 
macros.  I'm not a good enough programmer to understand a lot of it.


PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php