The long and short is that if we can get SCRIPT_NAME right,
the rest is cake...

> On Jan 26, 2017, at 4:07 AM, David Zuelke <d...@heroku.com> wrote:
> 
> On 26.01.2017, at 06:16, Eric Covener <cove...@gmail.com> wrote:
>> 
>> On Wed, Jan 25, 2017 at 6:12 PM, David Zuelke <d...@heroku.com> wrote:
>>>> AddType application/x-php7-fpm .php
>>>> Action application/x-php7-fpm /php7-fpm virtual
>>>> <Location /php7-fpm>
>>>>   SetHandler proxy:fcgi://localhost:9000
>>>> </Location>
>>>> 
>>>> setup. This shows what the httpd conf looks like...
>>>> can you provide a barebones fpm setup?
>>>> 
>>>> Thx!
>>> 
>>> Just curious; what's the practical difference between that and something 
>>> like:
>>> 
>>> <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://…
>>>   </If>
>>> </FilesMatch>
>> 
>> I think only the former would pass the original requested path as
>> PATH_INFO, unless there was more config w/ the latter (e.g. sending
>> everything to some single front controller so this snippet always sees
>> index.php)
> 
> Appears to depend on the rewrite (all of these with 2.4.18, SetHandler, and 
> cgi.fix_pathinfo=1):
> 
> GET index.php/ohai:
> 
> $_SERVER['PATH_TRANSLATED']   redirect:/index.php/ohai
> $_SERVER['PATH_INFO'] /ohai
> $_SERVER['SCRIPT_NAME']       /index.php
> $_SERVER['REQUEST_URI']       /index.php/ohai
> $_SERVER['SCRIPT_FILENAME']   /app/index.php
> 
> RewriteRule ^(.+)$ index.php/$1 [L], GET /ohai:
> 
> $_SERVER['PATH_TRANSLATED']   redirect:/index.php/ohai
> $_SERVER['PATH_INFO'] /ohai
> $_SERVER['SCRIPT_NAME']       /index.php
> $_SERVER['REQUEST_URI']       /ohai
> $_SERVER['REDIRECT_URL']      /ohai
> $_SERVER['SCRIPT_FILENAME']   /app/index.php
> 
> RewriteRule ^ index.php [L], GET /ohai:
> 
> $_SERVER['SCRIPT_NAME']       /index.php
> $_SERVER['REQUEST_URI']       /ohai
> $_SERVER['REDIRECT_URL']      /ohai
> $_SERVER['SCRIPT_FILENAME']   /app/index.php
> 
> Last case is missing PATH_INFO and PATH_TRANSLATED. That's what many PHP 
> frameworks (e.g. Laravel or Symfony) use, and I think they pull the URL 
> straight from REQUEST_URI now.
> 
> David
> 

Reply via email to