很简单,只需要修改虚拟主机中的root 即可(usr/local/nginx/conf/vhost/XXX.conf)
参考 : https://www.cnblogs.com/freeweb/p/5261077.html
然后重启即可。
我修改之后遇到下面这个问题
[15-Dec-2017 10:42:45 PRC] PHP Warning: require(): open_basedir restriction in effect. File(/home/wwwroot/diyiyj_b2b2c/bootstrap/autoload.php) is not within the allowed path(s): (/home/wwwroot/diyiyj_b2b2c/public/:/tmp/:/proc/) in /home/wwwroot/diyiyj_b2b2c/public/index.php on line 14
[15-Dec-2017 10:42:45 PRC] PHP Warning: require(/home/wwwroot/diyiyj_b2b2c/bootstrap/autoload.php): failed to open stream: Operation not permitted in /home/wwwroot/diyiyj_b2b2c/public/index.php on line 14
[15-Dec-2017 10:42:45 PRC] PHP Fatal error: require(): Failed opening required '/home/wwwroot/diyiyj_b2b2c/public/../bootstrap/autoload.php' (include_path='.:/usr/local/php/lib/php') in /home/wwwroot/diyiyj_b2b2c/public/index.php on line 14
即 open_basedir restriction in effect,解决php引入文件权限问题
查看问题描述以及资料,发现是php open_basedir 配置的问题,php不能引入其授权目录上级及其以上的文件,默认配置在php.ini(/usr/local/php/etc/php.ini),但是我的open_basedir 并没有配置,默认被注释了。
文献说可能在服务器配置目录下,如nginx、Apache等,于是用户sublime打开nginx进行全局搜索,open_base,果真还是搜到了。
参考: http://www.zhimengzhe.com/php/338363.html