修改 D:\BtSoft\nginx\conf\php\7.x.conf 文件,让宝塔 nginx 支持 PATH_INFO
#PHP-INFO-START
location ~ \.php(.*)$ {
try_files $uri =404;
fastcgi_pass 127.0.0.1:20074;
fastcgi_index index.php;
set $path_info "";
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") {
#将文件地址赋值给变量 $real_script_name
set $real_script_name $1;
#将文件地址后的参数赋值给变量 $path_info
set $path_info $2;
}
#配置fastcgi的一些参数
fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
fastcgi_param SCRIPT_NAME $real_script_name;
fastcgi_param PATH_INFO $path_info;
include fastcgi_params;
}
#PHP-INFO-END