Re: Getting PHP-FPM working

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hello John,

a Proxy-request didn't rewrite the url.

If you have http://my.example.com/myapp/script.php
then you can configure with ProxyPassMatch:

ProxyPassMatch "^/myapp/.*\.php(/.*)?$" "fcgi://localhost:9000/var/www/"

where script.php is located at /var/www/myapp/script.php
The parenthesis above aren't used to remember anything but to match everything
after ".php".

The layout of the directory within the fcgi environment must match
the layout of the url path.

One more excerpt from the manual:

"
The following example passes the request URI as a filesystem path for the PHP-FPM daemon to run. The request URL is implicitly added to the 2nd parameter. The hostname and port following fcgi:// are where PHP-FPM is listening. Connection pooling is enabled.
PHP-FPM

ProxyPassMatch "^/myapp/.*\.php(/.*)?$" "fcgi://localhost:9000/var/www/" enablereuse=on

"

In your environment you can request http://your.server/i_phpinfo.php

regards,

Christian

On Tue, May 16, 2017 at 12:05:06PM -0400, John Iliffe wrote:
> Hi Eric:
> 
> I'm a bit slow-witted I guess, in any event, I now have strace installed 
> and I ran it to get the attached trace file.
> 
> It's seems to me that the problem is in the call:   (about 250 lines before 
> the end of the file at time stamp 11:39:16)
> 
> 18767 11:39:16 lstat("/httpd/iliffe/i_phpinfo.php/info", 0x7fff1d6b4f90) = -1 
> ENOTDIR (Not a directory)
> 
> where the path information from the initial call is being appended to the 
> correct path information in the second parameter of ProxyPassMatch.  (???) 
> 
> FYI, the configuration directive is:
> 
> ProxyPassMatch ^/info$ fcgi://127.0.0.1:9015/httpd/iliffe/i_phpinfo.php
> 
> so I don't understand why this would happen. 
> 
> So, over to you.
> 
> Regards,
> 
> John
> ========================================
> 
> On Sunday 14 May 2017 11:42:53 Eric Covener wrote:
> > On Sat, May 13, 2017 at 11:01 PM, John Iliffe <john.iliffe@xxxxxxxxx> wrote:
> > > Sure:
> > > 
> > > ----------------------
> > > # namei -m /httpd/iliffe/i_phpinfo.php
> > > f: /httpd/iliffe/i_phpinfo.php
> > > 
> > >  dr-xr-xr-x /
> > >  drwxr-xr-x httpd
> > >  drwxr-xr-x iliffe
> > >  -rw-r--r-- i_phpinfo.php
> > > 
> > > ----------------------
> > 
> > There's something odd  about that code/logging (no parameter on the
> > open call repesenting the name!) Can you strace the FPM process and
> > see what it actually tries to open?
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
> > For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux