应用配置文件:

server {
    listen 80;
    server_name    xxx.com;


    access_log    /home/wwwlogs/xxx.com_access.log;
    error_log    /home/wwwlogs/xxx.com_error.log;
    set        $root    /home/wwwroot/xxx.com/public;


    location ~ .*\.(gif|jpg|jpeg|bmp|png|ico|txt|js|css)$
    {
        root $root;
    }


    location / {
        root    $root;
        index    index.html index.php;
        if ( -f $request_filename) {
            break;
        }
        if ( !-e $request_filename) {
            rewrite ^(.*)$ /index.php/$1 last;
            break;
        }
    }


    location ~ .+\.php($|/) {
        fastcgi_pass    unix:/tmp/php-cgi.sock;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param   PATH_INFO   $fastcgi_path_info;
fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param    SCRIPT_FILENAME    $root$fastcgi_script_name;
        include        fastcgi_params;
    }

}


Access denied:

     php.ini中找到  cgi.fix_pathinfo=0 改为  cgi.fix_pathinfo=1 

     然后再到nginx.conf中,添加 fastcgi_split_path_info ^(.+\.php)(/.+)$;

Thinkphp5+LNMP1.4的配置过程

thinkphp5报input file specified:

Thinkphp5+LNMP1.4的配置过程

注释 fastcgi.conf 中最后一行 如上图

相关文章:

  • 2021-11-11
  • 2021-09-08
  • 2022-02-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-16
  • 2022-12-23
  • 2021-11-12
  • 2021-07-18
  • 2021-09-08
  • 2022-12-23
相关资源
相似解决方案