当前位置: > Linux服务器 > nginx >

lnmp环境中如何为nginx开启pathinfo

时间:2015-02-19 14:49来源:linux.it.net.cn 作者:IT

如果是用lnmp脚本一键安装的开发环境,可以通过如下方式开户pathinfo:

1、注释nginx.conf中的try_files(因为跟pathinfo.conf中的重复了),开启pathinfo.conf配置:

?
1
2
3
4
5
6
7
8
9
location ~ [^/]\.php(/|$)
{
  # comment try_files $uri =404; to enable pathinfo
  #try_files $uri =404;
  fastcgi_pass unix:/tmp/php-cgi.sock;
  fastcgi_index index.php;
  include fastcgi.conf;
  include pathinfo.conf;
}

即注释掉第4行,打开第8行。

2、重启nginx服务:

nginx -s reload




(责任编辑:IT)
------分隔线----------------------------
栏目列表
推荐内容