咨询热线:4006-75-4006
售前:9:00-23:30 备案:9:00-18:00 技术:7*24h
LuManager中的Nginx让支持pathinfo
1、网站管理中找到要支持PATHINFO的网站,然后点击右边的“修改”。
2、找到 Nginx扩展设置(location段).
3、在location中填入下列:
location ~* \.(php[3-9]?|phtm[l]?)(\/.*)*$ {
fastcgi_index index.php;
fastcgi_pass 127.0.0.1:8999;
include fastcgi_params;
set $path_info "";
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
set $real_script_name $1;
set $path_info $2;
}
fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
fastcgi_param SCRIPT_NAME $real_script_name;
fastcgi_param PATH_INFO $path_info;
}
4、保存并重启Nginx服务即可。
测试代码:
正常情况下,你可以看到it works
如果您点击下面的链接还是可以看到上面的文字而不是404,说明支持pathinfo
index.php/home
PATH_INFO:
echo $_SERVER['PATH_INFO'];
?>