nginx not sending DOCUMENT_ROOT to PHP?

Maxim Dounin mdounin at mdounin.ru
Fri Nov 21 20:06:33 MSK 2008


Hello!

On Fri, Nov 21, 2008 at 10:34:44AM -0600, Joe Shang wrote:

> I am using:
> 
>                 location ~ \.php$ {
>                         fastcgi_pass unix:/home/nginx/phpcgi/vidiscri;
>                         fastcgi_index index.php;
>                         fastcgi_param SCRIPT_FILENAME
> /home/vidiscri/public_html$fastcgi_script_name;
>                         fastcgi_param DOCUMENT_ROOT $document_root;
>                         include conf/fastcgi_params;
>                 }
> 
> 
> To send PHP over to be parsed by php-fpm , but the problem is,
> DOCUMENT_ROOT variable isn't being sent to PHP it keeps saying:
> 
> _SERVER["DOCUMENT_ROOT"]	/usr/local/nginx/html
> 
> Any specific reason why its doing this?

Any specific reason why it should do something else?  You pass 
$document_root variable, and in config snipped you provided 
nothing defines root to something else.

Maxim Dounin





More information about the nginx mailing list