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

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

WBOY
WBOYOriginal
2016-08-08 09:06:451402Durchsuche

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

回复内容:

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

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

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

重启nginx试试

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn