![php5-fpm + nginx + drupal7:一直向我发送 index.php 供下载](https://linux22.com/image/547785/php5-fpm%20%2B%20nginx%20%2B%20drupal7%EF%BC%9A%E4%B8%80%E7%9B%B4%E5%90%91%E6%88%91%E5%8F%91%E9%80%81%20index.php%20%E4%BE%9B%E4%B8%8B%E8%BD%BD.png)
我绞尽脑汁也想不出为什么:
我的虚拟主机位于 /etc/nginx/sites-available/
server {
listen 80 default;
location /
{
root /var/www;
index index.php;
}
location ~* \.php$
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
include fastcgi_params;
}
}
nginx.conf
user www;
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 768;
multi_accept on;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
server_tokens off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
gzip_disable "msie6";
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
已安装的软件包
- php5-cgi
- php5-fpm
- php5-mysql
- nginx
在全新安装的 ubuntu 11.04 上。
通过 curl 命令查看 ip 时,php 文件显示“未解释”
答案1
建议您最大化所有日志的详细程度,并粘贴与您的“未解释”请求相关的所有日志条目。
另外,我昨天刚刚设置了一个服务器,组件不同,但结果却是相同的非解释结果 - 原来我只是没有重新启动所有适当的服务来选择 php 引擎进行解析。