Welcome! Log In Create A New Profile

Advanced

$document_root variable not working

Thomas Krause
May 24, 2012 05:46PM
Hi,

I'm running nginx 1.2.0 under FreeBSD 9.0.
I configured phpMyAdmin to execute unter
https://server/pma
which is working fine, but php scripts outside
/pma I get "File not found."
(e.g. https://server/info.php)

this is my config:

location / {
root /usr/local/www/nginx;
index index.html index.php;
}

location /pma {
root /usr/local/www;
index index.php;
}

location ~ \.php$ {
set $php_root $document_root;
if ($request_uri ~* /pma) {
set $php_root /usr/local/www;
}

fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $php_root$fastcgi_script_name;
include /usr/local/etc/nginx/fastcgi_params
}

The problem is the config line
set $php_root $document_root;
When I replace it with
set $php_root /usr/local/www/nginx;
everything is okay. I found in the documentation,
that $document_root should contain the value
of "root", but obvious it isn't.

Any ideas whats wrong?

Regards,
Tom.

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

$document_root variable not working

Thomas Krause May 24, 2012 05:46PM

Re: $document_root variable not working

Francis Daly May 24, 2012 06:44PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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