lnmp.org如何更改TP6.0框架的pathinfo模式.

网上好多都不管用,搞了一天,最后尝试了一下,只需要改一个就好了.
将include enable-php.conf 改为 include enable-php-pathinfo.conf即可
然后 lnmp restart

这是一键安装后的 nginx.conf 文件的配置原文

server
 { listen 443 ssl;
 listen 80 default_server;
 #listen [::]:80 default_server ipv6only=on;
 server_name _;#写自己的域名
 index index.html index.htm index.php;
 root /home/wwwroot/default;
 #error_page   404   /404.html;
 # Deny access to PHP files in specific directory #location ~ /(wp-content|uploads|wp-includes|images)/.*.php$ { deny all; }
 include enable-php.conf;#这是替换的地方:将include enable-php.conf 改为 include enable-php-pathinfo.conf
 location /nginx_status
 {
 stub_status on;
 access_log off;
 }
 location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$
 {
 expires 30d;
 }
 location ~ .*.(js|css)?$
 {
 expires 12h;
 }
 location ~ /.well-known {
 allow all;
 }
 location ~ /.
 {
 deny all;
 }
 access_log /home/wwwlogs/access.log;
 }

然后就好了!

lnmp.org如何更改TP6.0框架的pathinfo模式._第1张图片

你可能感兴趣的:(php,linux,nginx,运维)