首页 > Ubuntu16.04下apt-get安装nginx+php,根目录访问php文件,显示404

Ubuntu16.04下apt-get安装nginx+php,根目录访问php文件,显示404

浏览器访问phpinfo.php文件,显示404错误,php版本为7.0


在nginx的配置文件nginx.conf中的server{}段加入

location / {
        try_files $uri $uri/ /index.php?$query_string;
}

重启nginx试试

【热门文章】
【热门文章】