PHP fastcgi sninppet for Debian jessie

Christos Trochalakis yatiohi at
Wed Oct 8 08:20:27 UTC 2014

Hello Peter,

On Tue, Oct 07, 2014 at 01:33:26PM +0200, Peter Wu wrote:
>On Tuesday 07 October 2014 13:22:56 Christos Trochalakis wrote:
>> Hello all,
>> We are thinking about shipping a php-fastcgi snippet with the upcoming jessie
>> debian stable release. I wanted to bring that to your attention to avoid
>> shipping a broken config file that will be difficult to revert.
>> the snippet:
>> the default site config that references it:
>> Any comments are welcome!
>It looks functional (though the PATH_INFO config looks like a workaround for a
>bug, couldn't that bug/feature be fixed instead?).

It's known and desired behaviour, as Maxim Dunin's says in

>Why do you have a separate fastcgi.conf while fastcgi_params already exists?
>Actually, it seems that Igor Sysoev added this file in December 2009. Igor, why
>is the file duplicated if the only difference is in SCRIPT_FILENAME?

This is a recent addition to the debian package, we wanted to be as
close to upstream as possible. Less entropy is always good :)

>Christos, the configuration example allows for execution of xyz.php files in the
>document root. Another case is the use of frameworks which have a single
>controller, such as FuelPHP and Laravel. In such cases, this nginx configuration
>is sufficient (using the old config):
>    location ~ ^/($|api/|user/|...) {
>        try_files $uri @php_router;
>    }
>    location @php_router {
>        include fastcgi_params;
>        fastcgi_param SCRIPT_FILENAME /path/to/php/controller.php;
>        fastcgi_pass unix:/var/run/;
>    }

Yes, I wanted to catch the simplest setup of serving PHP files from your
document root. Other, more complex, use cases will require a little bit
of searching by the administrator.

Thanks a lot for your comments :)

More information about the nginx-devel mailing list