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;
}
然后就好了!
特别申明:本文内容来源网络,版权归原作者所有,如有侵权请立即与我们联系(cy198701067573@163.com),我们将及时处理。
php介绍
PHP即“超文本预处理器”,是一种通用开源脚本语言。PHP是在服务器端执行的脚本语言,与C语言类似,是常用的网站编程语言。PHP独特的语法混合了C、Java、Perl以及 PHP 自创的语法。利于学习,使用广泛,主要适用于Web开发领域。