解决nginx下不能require根目录之外的文件

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

一、vi  /usr/local/nginx/conf/nginx.confcss

在http下添加nginx

include fastcgi.conf

:wq保存bash

二、vi /usr/local/nginx/conf/fastcgi.conf网站

找到下面的这句ui

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

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

fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/:/home/wwwroot/default/";
相关文章
相关标签/搜索