Home > php教程 > php手册 > body text

lnmp一键安装环境中nginx开启pathinfo,lnmpnginx

WBOY
Release: 2016-06-13 09:19:30
Original
1015 people have browsed it

lnmp一键安装环境中nginx开启pathinfo,lnmpnginx

问题及原理可参考:http://www.laruence.com/2009/11/13/1138.html

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

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

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

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

2、重启nginx服务:

nginx -s reload
Copy after login

 

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template