我们常规的做法是将统一入口文件、css、js这些放在网站根木,其他php文件放到根目录外部,这个时候nginx访问是require不到的,需要设定一下

1、编辑nginx配置文件

vi  /usr/local/nginx/conf/nginx.conf

在http下添加

include fastcgi.conf

:wq保存

2、vi /usr/local/nginx/conf/fastcgi.conf

找到下面的这句

fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/";

修改为(假定你要包含的目录是/home/wwwroot/default)

fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/:/home/wwwroot/default/";