This is part of my nginx configuration file:
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/$fastcgi_script_name;
include fastcgi_params;
}
Almost the website loads because the location of / is also set to /var/www on this config file.
location / {
root /var/www;
index index.php index.html index.htm;
}
When I use phpinfo() and read PHP variables table, I noticed this:
_SERVER["DOCUMENT_ROOT"] /usr/share/nginx/html
Other variables (most of them configured in nginx.conf)as server name, script filename, etc, were sent to php. So, nginx doesn't sending this variable to PHP. What I have to do?
I'm using PHP 5.3.8 and nginx 0.8
fastcgi_param DOCUMENT_ROOT $document_root;
in your fastcgi_parms file)