1,is_dir():open_basedir restriction in effect.
php报错is_dir():open_basedir restriction in effect. File(.log) is not within the allowed path(s)。
这种情况为 open_basedir 限制了 PHP 可以操作的文件目录。开发环境不考虑安全问题的话,如果需要操作这些文件,解决方法可以是:
Nginx/Tengine 修改方法:
vi /usr/local/nginx/conf/fastcgi.conf// 添加fastcgi_param PHP_ADMIN_VALUE "open_basedir=/home/wwwroot/:/tmp/:/proc/";
Apache 修改方法:
打开 域名.conf 文件,搜索open_basedir:
php_admin_value open_basedir "/home/wwwroot/www.demo.cn/:/tmp/:/var/tmp/:/proc/"
