Home  >  Article  >  Backend Development  >  Open nginx pathinfo in lnmp one-click installation environment

Open nginx pathinfo in lnmp one-click installation environment

WBOY
WBOYOriginal
2016-08-08 09:32:59905browse

For questions and principles, please refer to: http://www.laruence.com/2009/11/13/1138.html

If you use the lnmp script to install a development environment with one click, you can open a pathinfo account in the following way:

1. Comment try_files in nginx.conf (because it is duplicated with pathinfo.conf) and enable pathinfo.conf configuration:

<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> }

Comment out line 4 and open line 8.

2. Restart nginx service:

nginx -s reload

The above introduces the nginx opening pathinfo in the lnmp one-click installation environment, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
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
Previous article:PHP uses memcachedNext article:PHP uses memcached