admin管理员组

文章数量:1565797

2024年7月29日发(作者:)

open_basedir restriction in effect的错误及其解决办法

做测试的时候 发现一个问题。新增加的文章点删除的

时候会出现 Warning: file_exists() [-exists]:

open_basedir restriction in effect. File(../) is not

within the allowed path(s):

(D:/mywebserver/DedeAMPZ/WebRoot/Default) in

D:mywebserverDedeAMPZWebRootDefaultincludesfu

on line 801

Warning: file_exists() [-exists]: open_basedir

restriction in effect. File(../../) is not within the

allowed path(s):

(D:/mywebserver/DedeAMPZ/WebRoot/Default) in

D:mywebserverDedeAMPZWebRootDefaultincludesfu

on

line 806

以上错误。 本座初期怀疑是程序本身的问题,资料翻来覆

去的看都是没有解决。都感觉自己脑袋混沌了。狂抽烟,抽

了一顿之后。便便了一下。一下就轻松了!~~突然脑袋就清

醒了。觉得应该是出现在环境问题上。检查了一下阿帕奇和

的配置信息。原来真的是环境的问题 ! 最近刚刚

收了个徒弟,顺便帮他解决类似问题。下面把同样的问题也

列出来

问题2:

Warning: Unknown: open_basedir restriction in effect.

File(D:/99Game/WEB/htdocs/) is not within the

allowed path(s):

(D:GameWEBhtdocs;C:WINDOWSTemp;) in Unknown

on line 0

Fatal error: Can't load D:/99Game/WEB/htdocs/,

open_basedir restriction. in Unknown on line 0

问题3:

Warning: imagegif() [if]: open_basedir

restriction in effect. File(C:WINDOWSTEMP) is not within

the allowed path(s): (C:PHPnowhtdocs;C:PHPnowTemp)

in C:PHPnowhtdocshdzsverify_ on line 11

Warning: imagegif() [if]: Unable to open

temporary file in C:PHPnowhtdocshdzsverify_

on line 11

问题4:

虚拟主机,运行一个程序时出现以下错误提示:

Warning: file_exists(): open_basedir restriction

in effect.

File(/home/mainwebsite_html/cache/also_purchased-engli

11548) is not within the allowed

path(s): (/var/web/w0895/:/tmp:/usr/lib/php) in

/var/web/w0895/html/includes/functions/

on line 47

问题是出现在了上面了

原因是里设置了

opendir=/var/web/w0895/:/tmp:/usr/lib/php

解答:

其实open_basedir 这个是用来限制php的目录访问权限什

么的,如果不在允许的范围内,php就不能访问。

这个 open_basedir 在 里可以设定,也可以在

apache的 里面设定

例如:

php_admin_value open_basedir

"E:/APMServ5.2.6/www/wordpress/;E:/APMServ5.2.6/tmp/

uploadtemp/;"

再比如:

php_admin_value open_basedir

=/var/web/w0895/:/tmp:/usr/lib/php

上面问题中的描述,看字面意思好像是open_basedir受到

了限制 D:GameWEBhtdocs;C:WINDOWSTemp; 不属

于允许路径,php我没接触过是不是有个open_basedir的配

置文件?是负责目录权限的?

php程序里的目录是D:/99Game/WEB/htdocs/,

但出错的目录是D:GameWEBhtdocs

你把D:Game改成D:99Game看看

本文标签: 问题目录出现程序错误