php出现这类怎么解决 100

PHPWarning:Unknown:open_basedirrestrictionineffect.File(D:\wwwroot\www.chiis.org\inde... PHP Warning: Unknown: open_basedir restriction in effect. File(D:\wwwroot\www.chiis.org\index.php) is not within the allowed path(s): (/www/wwwroot/website/:/tmp/:/proc/) in Unknown on line 0
PHP Warning: Unknown: failed to open stream: Operation not permitted in Unknown on line 0
展开
 我来答
千锋教育
2017-12-01 · 做真实的自己 用良心做教育
千锋教育
千锋教育专注HTML5大前端、JavaEE、Python、人工智能、UI&UE、云计算、全栈软件测试、大数据、物联网+嵌入式、Unity游戏开发、网络安全、互联网营销、Go语言等培训教育。
向TA提问
展开全部
在打开错误时发现提示 Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(../license.php) is not within the allowed path(s): 错误了,下面一起来看此问题解决办法
先来看配置文件

$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):
问题是出现在了PHP.INI上面了

原因是php.ini里设置了
open_basedir=/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问题解决了。
匿名用户
2017-12-01
展开全部
可以在php.ini 或者apache的httpd.conf 里设定open_basedir
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
朋春燕026
2017-12-01 · 超过14用户采纳过TA的回答
知道答主
回答量:69
采纳率:57%
帮助的人:15.5万
展开全部
没权限呀,是不是在Linux上使用啊
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 1条折叠回答
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式