最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
php错误提示 open_basedir restriction in effect 解决
时间:2022-06-24 23:19:42 编辑:袖梨 来源:一聚教程网
先来看配置文件
$cache = new Cache(43200,'D:/wwwroot/cache/tmp/anzhuo/');//参数1 秒,参数2内容
$page = intval(isset($_GET['page'])?$_GET['page']:1);
$key = 'anzhuo_data_4'.$page;
$values = $cache->display($key);
这个是生成缓存文件了,但是发现生成是提示
Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(../license.php) is not within the allowed path(s):
这个百度直接搜索 open_basedir restriction in effect 错误看到如下图所示答案
问题是出现在了PHP.INI上面了
原因是php.ini里设置了
opendir=/var/web/w0895/:/tmp:/usr/lib/php
解答:
其实open_basedir 这个是用来限制php的目录访问权限什么的,如果不在允许的范围内,php就不能访问。
这个 open_basedir 在 php.ini 里可以设定,也可以在 apache的httpd.conf 里面设定
例如:
php_admin_value open_basedir "D:/wwwroot/cache/tmp/anzhuo/"
再比如:
php_admin_value open_basedir =/var/web/w0895/:/tmp:/usr/lib/php
好了再重启apache问题解决了。
相关文章
- 洛伊的移动要塞路易强度说明 10-14
- 洛克王国世界黑猫巫师怎么获得-黑猫巫师获取攻略 10-14
- 三角洲行动10月14日摩斯密码是什么 各地点对应密码汇总 10-14
- 出战追击兑换码是什么 出战追击2025最新兑换码大全 10-14
- 向僵尸开炮兑换码有哪些 2025最新可用兑换码大全 10-14
- 为了吾王兑换码是什么 为了吾王2025最新兑换码大全 10-14