加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

require,include和require_once,include_once 出现open_basedi

发布时间:2020-12-13 20:38:25 所属栏目:PHP教程 来源:网络整理
导读:只要使用require或include包含文件(不管是./xx.php还是xx.php)都是报下面的错误 Warning: include() [function.include]: open_basedir restriction in effect. File() is not within the allowed path(s): (/var/www/:/tmp/:/var/cache/) in /var/www/tes

只要使用require或include包含文件(不管是./xx.php还是xx.php)都是报下面的错误

Warning: include() [function.include]: open_basedir restriction in effect. File() is not within the allowed path(s): (/var/www/:/tmp/:/var/cache/) in /var/www/testdir.php on line 2

php 5.2.17听说 open_basedir 有所改动,查看发现原来php5.2.10中的php.ini是使用右斜杠:open_basedir = "e:/web/;C:/WINDOWS/TEMP/;"

升级到5.2.17 就tmd一直报错,改成左斜杠就好了,这叫什么事,难怪很多程序都会手工处理一下斜杠问题,估计就为了应对这一出:open_basedir = "e:web;C:WINDOWSTEMP;"

这样就解决了,如果不是php设置问题错误提示一般是 Warning: include() [function.include]: URL file-access is disabled in the server configuration

这个解决办法只要把包含路径调正常即可。

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读