php - ngnix 不打开文件而是下载文件怎么回事
本文介绍了php - ngnix 不打开文件而是下载文件怎么回事的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 8089;
server_name localhost;
root D:\workspace/hangjiayun;
index index.html index.htm index.php;
location / {
try_files $uri $uri/ /index.php;
}
location ~ \.php$ {
try_files $uri =404;
include fastcgi.conf;
fastcgi_pass 127.0.0.1:9000;
}
}
}
解决方案
应该是php文件没有解析,确保php-fpm正常启动的情况下,
看下你的nginx配置是否正确fastcgi_pass 127.0.0.1:9000;
这篇关于php - ngnix 不打开文件而是下载文件怎么回事的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文