WDlinux官方论坛's Archiver

serjun 发表于 2018-8-21 11:20

Thinkphp 的Pathinfo配置解决方法(亲测)

第一次写解决方法,给菜鸟的,大神请飘过~~~
2个步骤
1.开启php.ini中设置cgi.fix_pathinfo=1

(上传不了图片,可能等级不够!)

2.修改vhost里域名配置文件



server {
        listen 80;
        server_name 你的域名;
        root "网站目录";
        location / {
        index index.html index.htm index.php l.php;
        autoindex on;
        try_files $uri $uri/ /index.php?s=$uri&$args;
        }
        error_page 500 502 503 504 /50x.html;
        location = /50x.html {
        root html;
        }
        location ~ \.php {  
        root  网站目录;
        fastcgi_pass unix:/tmp/php-55-cgi.sock;
        fastcgi_index index.php;
        fastcgi_split_path_info ^(.+\.php)(.*)$;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;

        }

}

注意修改中文部分,有什么不明白可以留言!

xindi520 发表于 2019-6-13 04:59

楼主正解,表示钦佩

页: [1]

Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.