Warning: require(): open_basedir restriction in effect. File(/home/wwwroot/default/1211/bootstrap/autoload.php) is not within the allowed path(s): (/home/wwwroot/default/1211/public/:/tmp/:/proc/) in /home/wwwroot/default/1211/public/index.php on line 22
出现这个问题的原因是由于lnmp配置的时候fastcgi.conf配置PHP_ADMIN_VALUE为”open_basedir=$document_root/:/tmp/:/proc/”,而且在配置虚拟主机的时候fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
就会指定到你配置的路径中,如下:
listen 80;
server_name dingdang.com;
index index.html index.htm index.php;
root /home/wwwroot/default/dateApi/public;
#deny download when you open some file
include enable-php.conf;
在fastcgi.conf
中fastcgi_param PHP_ADMIN_VALUE "open_basedir=/home/wwwroot/default/1211/public/:/tmp/:/proc/";
中的/home/wwwroot/default/1211/public/
改成/home/wwwroot/
就可以了,同时注释掉php.ini中的open_basedir;
以上问题是我出现过的,问题一样,但是,路径是网上另一位同仁的,
我是这样修改和理解的,如有异议,请在下方留言,共同讨论