Global PHP Rule

Mathew Davies thepixeldeveloper at googlemail.com
Mon May 4 05:05:02 MSD 2009


I guess I'll live with it for now.

The idea was to not repeat this data so it'd be easier to setup PHP on a
variety of domains without repetition. Maybe Igor can look at this as a new
feature request.

Thank You.

2009/5/4 Jim Ohlstein <jim.ohlstein at gmail.com>

>
>
> Michael Shadle wrote:
>
>> On Sun, May 3, 2009 at 5:06 PM, Mathew Davies
>> <thepixeldeveloper at 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
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20090504/20fc2bd0/attachment.html>


More information about the nginx mailing list