```
server {
listen 80;
server_name localhost;
root /home/user/www;
index index.html index.htm index.php;
location ~ \.php$ {
include fastcgi_params;
fastcgi_index index.php;
fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
```
LOG的错误是
```
2015/05/23 00:58:54 [error] 6007#0: *1 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/php-fpm.sock:", host: "127.0.0.1"
```
路径没错。其他文件都可以访问。
折腾了一天,不知道如何解决。
Google出来的都是说fastcgi_param配置错误,然而我改了貌似也不行。
server {
listen 80;
server_name localhost;
root /home/user/www;
index index.html index.htm index.php;
location ~ \.php$ {
include fastcgi_params;
fastcgi_index index.php;
fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
```
LOG的错误是
```
2015/05/23 00:58:54 [error] 6007#0: *1 FastCGI sent in stderr: "Primary script unknown" while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/run/php-fpm/php-fpm.sock:", host: "127.0.0.1"
```
路径没错。其他文件都可以访问。
折腾了一天,不知道如何解决。
Google出来的都是说fastcgi_param配置错误,然而我改了貌似也不行。