美文网首页
让lnmp 支持 thinkphp5

让lnmp 支持 thinkphp5

作者: app_developer | 来源:发表于2018-11-23 11:29 被阅读0次

修改的配置文件主要在两个目录里

/usr/local/nginx/conf
/usr/local/nginx/conf/vhost

lnmp vhost add 添加完后,修改域名配置文件

root /home/wwwroot/域名目录/public; //工作目录配置到public
修改fastcgi.conf

#fastcgi_param PHP_ADMIN_VALUE "open_basedir=document_root/:/tmp/:/proc/"; fastcgi_param PHP_ADMIN_VALUE "open_basedir=document_root/../:/tmp/:/proc/";
配置站点的Conf文件, 在vhost文件夹中, 默认站点在nginx.conf. 添加以下代码

location / {
    if (!-e $request_filename){
        rewrite ^/(.*)$ /index.php?s=/$1 last;
    }
}

同时把

include enable-php.conf; 改为

include enable-php-pathinfo.conf;

最后别忘了重启nginx

相关文章

网友评论

      本文标题:让lnmp 支持 thinkphp5

      本文链接:https://www.haomeiwen.com/subject/hhxjqqtx.html