[Pkg-nginx-maintainers] Bug#841488: Bug#841488: improve suggested php config

Michael Lustfield michael at lustfield.net
Sat Oct 22 02:19:34 UTC 2016


> In snippets/fastcgi-php.conf, url:s like /index.php/some/path are 
> correctly split into /index.php and /some/path. But the suggested php 
> config in sites-available/default has the following line that can't 
> match /index.php/some/path:
> 
> location ~ \.php$ {
> 
> Please change that line to:
> 
> location ~ \.php($|/) {

Heh, that's funny. The former is an explicit preference. It was originally put
there in order to prevent the exact character you're trying to insert. This is
because of issues with PATH_INFO if the path information isn't properly split.

This is a topic discussed in depth elsewhere.

> It would also be nice to mention adding index.php to index directive in 
> the FastCGI section. There is comment above the index directive but I 
> didn't see it at first and probably many others are also too focused on 
> the fastcgi section and expect their php application to just work after 
> commenting out the fastcgi directives.
> 
> I think it would be clearer if the following line is removed from 
> sites-available/default:
> 
> # Add index.php to the list if you are using PHP
> 
> And the following lines is added after "# pass PHP scripts to FastCGI 
> server":
> 
> # (usually you also need to add index.php to the index directive above)

I'm not sure how this would provide a less confusing base configuration. If we
move the index directive, it becomes further buried. If we duplicate it, well,
that's just silly.

> And related to #841230, please replace "php5" with "php7.0" also in the 
> comments :-)

I'm more inclined to simply drop the number. It does nothing to help with
understanding that section.



More information about the Pkg-nginx-maintainers mailing list