nginx下看不到TP5的错误提示,但是Apache下可以

浏览:1231 发布日期:2017/07/29 分类:ThinkPHP5专区
每次报错在nginx下看不到类似下图的提示(图片是在开启Apache的时候截的)

而看到的都是404报错,但是Apache下是好的。

是不是nginx的设置有问题?附上各位大虾帮忙看看location ~ .*\.php {
    root           /data/www/public;
#    try_files $uri =404;
    fastcgi_intercept_errors on;
    fastcgi_index  index.php;
    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 PATH_INFO $path_info;
    fastcgi_param SCRIPT_NAME $real_script_name;
    include        fastcgi_params;
    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
    fastcgi_pass   php-fpm;
}
        location / { #这段里的内容写不写效果都一样
            index index.html index.htm index.php;
            if (!-e $request_filename) {
                rewrite ^/(.*)$ /index.php/$1 break;
                break;
            }
        }
最佳答案
评论( 相关
后面还有条评论,点击查看>>