Welcome! Log In Create A New Profile

Advanced

Re: Global PHP Rule

May 03, 2009 08:56PM
Michael Shadle wrote:
> On Sun, May 3, 2009 at 5:06 PM, Mathew Davies
> <thepixeldeveloper@googlemail.com> wrote:
>
>
>> location ~ \.php$
>> {
>> fastcgi_pass 127.0.0.1:9000;
>> fastcgi_index index.php;
>> fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
>> include fastcgi_params;
>> }
>> }
>>
>
> You can put these in fastcgi_params:
>
> fastcgi_index index.php;
> fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
>
> Also you can put all the fastcgi_params globally on the http {} block.
>
> I have done that, and it works well, there is some random situation
> though where if I try to override a fastcgi_param somewhere else, all
> of them get unset.
>
>
Correct me if I'm wrong, but you still have to put

location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;

...
}

for each server block where you want to configure php. Even if you are able to put the fastcgi_pass directive into fastcgi_params, something I haven't tried, you'd still need

location ~ \.php$ {

include fastcgi_params;
}

in any server block where you wanted to run run php scripts since fastcgi_pass has to be in a location block.


Jim
Subject Author Posted

Global PHP Rule

Mathew Davies May 03, 2009 08:06PM

Re: Global PHP Rule

mike May 03, 2009 08:40PM

Re: Global PHP Rule

Jim Ohlstein May 03, 2009 08:56PM

Re: Global PHP Rule

Mathew Davies May 03, 2009 09:05PM

Re: Global PHP Rule

edogawaconan May 03, 2009 09:25PM

Re: Global PHP Rule

mike May 03, 2009 09:33PM

Re: Global PHP Rule

Jim Ohlstein May 03, 2009 08:41PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 273
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready