按下面的配置,配置的 php7.0-fpm 和 nginx ,然后 reload 加载配置,结果发下 www.abc.com/index.php 访问后竟出现下载文件的对话框,而直接访问其他 test.php 可以正常,访问 www.abc.com/也可以正常,哪里需要修改访问 index.php 才能正常,谢谢。
sudo apt-get install php7.0-fpm php7.0-cgi php7.0-common php7.0-curl php7.0-mysql ;
sudo vim /etc/php/7.0/fpm/php.ini,设置 cgi.fix_pathinfo=0
sudo vim /etc/nginx/sites-enabled/www.abc.com
server { listen 80; listen [::]:80;
server_name test.app;
root /var/www/www.abc.com;
index index.html index.php;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
# With php7.0-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# With php7.0-fpm:
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
}
1
abc123ccc 2016-12-02 14:10:16 +08:00
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock; 位置对换一下???? |