open_basedir访问授权方式
PHP message: PHP Warning: is_dir(): open_basedir restriction in effect. File(/path/log) is not within the allowed path(s): (/path/www/ma/:/tmp/:/proc/) in /path/ma/vendor/monolog/monolog/src/Monolog/Han dler/StreamHandler.php on line 170 PHP message: PHP Warning: is_dir(): open_basedir restriction in effect. File(/path/log) is not within the allowed path(s): (/path/www/ma/:/tmp/:/proc/) in /www/ma/vendor/monolog/monolog/src/Monolog/Han dler/StreamHandler.php on line 165 PHP message: PHP Warning: is_dir(): open_basedir restriction in effect. File(/path/log) is not within the allowed path(s): (/path/www/ma/:/tmp/:/proc/) in /www/ma/vendor/monolog/monolog/src/Monolog/Han dler/StreamHandler.php on line 170
nginx.conf的http{}增加如下代码
fastcgi_param PHP_ADMIN_VALUE "open_basedir=/yourpath/:/tmp/:/proc/";
php.ini的open_basedir注释打开,并添加路径:
open_basedir=/yourpath/:/tmp/:/proc/
重启php
user.ini增加如下代码:
open_basedir=/yourpath/:/tmp/:/proc/
如上三种方式可解决上述问题。
open_basedir是php的一种安全机制,只允许访问经过授权的路径,所以每次在访问文件的时候都会检查相关路径是否在授权范围内,安全性提升的同时大大增加了I/O的读写压力,可通过逆向操作(注释掉或删除)上述三种配置路径去掉这一限制。
©️公众号:思考者文刀
- 上一篇: 通过nginx解决一个跨域问题
- 下一篇: 服务器安全加固常用项
评论
repostone
回复非技术的路过。