搜尋

首頁  >  問答  >  主體

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中文网2895 天前301

全部回覆(1)我來回復

  • 高洛峰

    高洛峰2017-04-10 17:38:04

    应该是php文件没有解析,确保php-fpm正常启动的情况下,
    看下你的nginx配置是否正确
    fastcgi_pass 127.0.0.1:9000;

    回覆
    0
  • 取消回覆