部署上线后给runtime777权限,然后参考官方文档设置php.ini里把open_basedir打开
参考:https://www.kancloud.cn/manual/thinkphp5/336757
然后,vhost里域名目录自相xxx/public/
伪静态设置:
location / {
if (!-e $request_filename){
rewrite ^/(.*)$ /index.php?s=/$1 last;
}
}
/usr/local/nginx/conf/fastcgi.conf里面
fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/";
之后添加
fastcgi_param PHP_ADMIN_VALUE $basedir if_not_empty;#注意nginx要在1.1.11版本之后
$basedir变量就可以在/usr/local/nginx/conf/vhost/xxx.com.conf配置文件里的include enable-php.conf前赋值:
xxx为上面项目主目录
set $basedir "open_basedir=/home/wwwroot/xxx/:/tmp/:/proc/";
自此完成!