首页 » php » thinkPHP 5 lnmp 下 rewrite 方法

thinkPHP 5 lnmp 下 rewrite 方法

 

因为thinkphp 5 的index.php入口文件 默认是在public目录下,

将nginx 的vhost 文件做以下修改

 

#此处需要指向到public目录
root /home/wwwroot/dzcj/public;

 

location ~ /
{
        try_files $uri $uri/ /index.php?s=$uri&$args;
}

 

 如果遇到以下问题,可以使用这个方法处理

Warning: require(): open_basedir restriction in effect. File(/home/wwwroot/www.abczn.com/thinkcmf/simplewind/thinkphp/base.php) is not within the allowed path(s): (/home/wwwroot/www.abczn.com/thinkcmf/public/:/tmp/:/proc/) in /home/wwwroot/www.abczn.com/thinkcmf/public/index.php on line 38

Warning: require(/home/wwwroot/www.abczn.com/thinkcmf/simplewind/thinkphp/base.php): failed to open stream: Operation not permitted in /home/wwwroot/www.abczn.com/thinkcmf/public/index.php on line 38

Fatal error: require(): Failed opening required '/home/wwwroot/www.abczn.com/thinkcmf/public/../simplewind/thinkphp/base.php' (include_path='.:/usr/local/php/lib/php') in /home/wwwroot/www.abczn.com/thinkcmf/public/index.php on line 38

 

 

原文链接:thinkPHP 5 lnmp 下 rewrite 方法,转载请注明来源!

0