Hello, I'm new to nginx so i'm sure i'm missing something basic...
I installed php and nginx on debian wheezy (virtualbox machine). Everything worked fine when I left the default root path at /usr/share/nginx/www. As soon as I change it to /var/www, php doesn't work any more (tags & commands are output to html text instead of interpreted).
Could there be some php setting i've missed?
This works:
server {
listen 80;
listen [::]:80 default_server ipv6only=on;
root /usr/share/nginx/www;
index index.php index.html index.htm;
server_name localhost;
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
##fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
This doesn't:
server {
listen 80;
listen [::]:80 default_server ipv6only=on;
root /var/www;
index index.php index.html index.htm;
server_name localhost;
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
##fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
I installed php and nginx on debian wheezy (virtualbox machine). Everything worked fine when I left the default root path at /usr/share/nginx/www. As soon as I change it to /var/www, php doesn't work any more (tags & commands are output to html text instead of interpreted).
Could there be some php setting i've missed?
This works:
server {
listen 80;
listen [::]:80 default_server ipv6only=on;
root /usr/share/nginx/www;
index index.php index.html index.htm;
server_name localhost;
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
##fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
This doesn't:
server {
listen 80;
listen [::]:80 default_server ipv6only=on;
root /var/www;
index index.php index.html index.htm;
server_name localhost;
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
##fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}