Welcome! Log In Create A New Profile

Advanced

Re: php fastcgi main/common config

Artifex Maximus
October 18, 2010 05:32AM
Hello!

On Thu, Oct 14, 2010 at 1:56 PM, Reinis Rozitis <r@roze.lv> wrote:
>> Have tried but gives http error 404 to all php script. I had changed
>> fastcgi_params, rearrange conf as you outlined. In brief:
>
> Can you compare (change) your fastcgi_params file to this and see if it
> works then (be sure to restart nginx too)?:
>
> fastcgi_param  QUERY_STRING       $query_string;
> fastcgi_param  REQUEST_METHOD     $request_method;
> fastcgi_param  CONTENT_TYPE       $content_type;
> fastcgi_param  CONTENT_LENGTH     $content_length;
> fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
> fastcgi_param  SCRIPT_NAME        $fastcgi_script_name;
> fastcgi_param  REQUEST_URI        $request_uri;
> fastcgi_param  DOCUMENT_URI       $document_uri;
> fastcgi_param  DOCUMENT_ROOT      $document_root;
> fastcgi_param  SERVER_PROTOCOL    $server_protocol;
> fastcgi_param  REMOTE_ADDR        $remote_addr;
> fastcgi_param  REMOTE_PORT        $remote_port;
> fastcgi_param  SERVER_ADDR        $server_addr;
> fastcgi_param  SERVER_PORT        $server_port;
> fastcgi_param  SERVER_NAME        $host;

I have copied this lines to my fastcgi_params and changed the
nginx.conf to the suggested one. My file had this line

fastcgi_param SERVER_NAME $server_name;

instead of yours.

I recompile nginx with debug feature to look deeper into
communication. On php request nginx found the required php related
config lines:

'2010/10/18 11:07:51 [debug] 45041#0: *1 using configuration "\.php$"'

But the document root variable is bad for some reason:

'2010/10/18 11:07:51 [debug] 45041#0: *1 http script copy: "SCRIPT_FILENAME"
2010/10/18 11:07:51 [debug] 45041#0: *1 http script var:
"/usr/local/etc/nginx/html"
2010/10/18 11:07:51 [debug] 45041#0: *1 http script var:
"/www/php/getplugins.php"
2010/10/18 11:07:51 [debug] 45041#0: *1 fastcgi param:
"SCRIPT_FILENAME: /usr/local/etc/nginx/html/www/php/getplugins.php"
2010/10/18 11:07:51 [debug] 45041#0: *1 http script copy: "SCRIPT_NAME"
2010/10/18 11:07:51 [debug] 45041#0: *1 http script var:
"/www/php/getplugins.php"'

It uses /usr/local/etc/nginx/html as document root instead of my
/www/site1. How could I define the document root for php scripts?

Bye,
a

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

php fastcgi main/common config

Artifex Maximus October 14, 2010 05:28AM

Re: php fastcgi main/common config

Reinis Rozitis October 14, 2010 05:48AM

Re: php fastcgi main/common config

Artifex Maximus October 14, 2010 06:12AM

Re: php fastcgi main/common config

Artifex Maximus October 14, 2010 07:42AM

Re: php fastcgi main/common config

Reinis Rozitis October 14, 2010 08:04AM

Re: php fastcgi main/common config

Artifex Maximus October 18, 2010 05:32AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 299
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