时间:2021-07-01 10:21:17 帮助过:4人阅读
问题及原理可参考:http://www.laruence.com/2009/11/13/1138.html
如果是用lnmp脚本一键安装的开发环境,可以通过如下方式开户pathinfo:
1、注释nginx.conf中的try_files(因为跟pathinfo.conf中的重复了),开启pathinfo.conf配置:
1 location ~ [^/]\.php(/|$) 2 { 3 # comment try_files $uri =404; to enable pathinfo 4 #try_files $uri =404; 5 fastcgi_pass unix:/tmp/php-cgi.sock; 6 fastcgi_index index.php; 7 include fastcgi.conf; 8 include pathinfo.conf; 9 }
即注释掉第4行,打开第8行。
2、重启nginx服务:
nginx -s reload
http://www.bkjia.com/PHPjc/923714.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/923714.htmlTechArticlelnmp一键安装环境中nginx开启pathinfo,lnmpnginx 问题及原理可参考:http://www.laruence.com/2009/11/13/1138.html 如果是用lnmp脚本一键安装的开发环境,可...