The fixes in that ticket were pretty risky as they very late in the game 
fiddled with strings. That was brittle should have been fixed earlier during 
request processing.

The new patch 
(https://bugs.php.net/patch-display.php?bug=65641&patch=Another_fix_for_mod_proxy_fcgi.patch&revision=1409922889)
 looks better, but doesn't account for cases where SCRIPT_NAME Is correct (not 
sure if that can be checked), and I don't understand why env_script_name is 
restored back to its original value after writing it to SCRIPT_NAME. At the 
very least, the comment in that if should say "this is for ProxyPass and 
SCRIPT_NAME being broken with index.php/foo".

But that doesn't matter anyway, because ProxyPass is a bag of hurt for a 
million and one reasons. Rewrites are not applied, you can't check if the file 
exists et cetera.

People should simply use the SetHandler approach instead. If your version of 
Apache 2.4 doesn't have that yet, use 
https://gist.github.com/progandy/6ed4eeea60f6277c3e39

David

P.S.: if you also want to check if the .php file exists:
<FilesMatch \.php$>
 <If "-f %{REQUEST_FILENAME}"> # make sure the file exists so that if not, 
Apache will show its 404 page and not FPM
   SetHandler "proxy:fcgi://127.0.0.1:9003"
 </If>
</FilesMatch>

P.P.S.: as a reminder, if you want to use UDS:
<Proxy "unix:/tmp/php.sock|fcgi://php">
 disablereuse off # any parameter in here will do so the proxy is registered 
during startup and can be referenced later as "fcgi://php"
</Proxy>
<FilesMatch \.php$>
 <If "-f %{REQUEST_FILENAME}">
   SetHandler "proxy:fcgi://php"
 </If>
</FilesMatch>

On 05.09.2014, at 05:54, Philip Hofstetter <phofstet...@sensational.ch> wrote:

> On Fri, Sep 5, 2014 at 1:18 PM, Remi Collet <r...@fedoraproject.org> wrote:
> 
>> 2. ProxyPass Configuration
>> 
>>    ProxyPass /proxy/ fcgi://127.0.0.1:9003//var/www/html/
>> 
>> URL = /proxy/info.php/a/b?q=a
>> SCRIPT_NAME = /proxy/info.php/a/b
>> => Broken
> 
> This is bugging me too on my development machine where I'm stuck at
> Apache 2.4.9 which doesn't yet have support for using SetHandler this
> way.
> 
> Applying the patch fpm_main-script_name-v2.patch  proposed on
> https://bugs.php.net/bug.php?id=65641 fixes the issue for me.
> 
> This is happening for me with PHP 5.4, 5.5 and 5.6 (which are the ones
> I tested).
> 
> Philip
> 
> -- 
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to