教程集 www.jiaochengji.com
教程集 >  脚本编程  >  php  >  正文 require,include和require_once,include_once 出现open_basedir错误

require,include和require_once,include_once 出现open_basedir错误

发布时间:2018-12-25   编辑:jiaochengji.com
教程集为您提供require,include和require,once,include,once 出现open,basedir错误等资源,欢迎您收藏本站,我们将为您提供最新的require,include和require,once,include,once 出现open,basedir错误资源
我们在require,include和require_once,include_once 出现open_basedir错误,下面百度了一些解决方法有, 需要的朋友可参考一下。

只要使用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是使用右斜杠

 

<table width="620" align="center" border="0" cellpadding="1" cellspacing="1" style="background:#FB7"> <tr> <td width="464" height="27" bgcolor="#FFE7CE"> 代码如下</td> <td width="109" align="center" bgcolor="#FFE7CE" style="cursor:pointer;" onclick="doCopy('copy2298')">复制代码</td> </tr> <tr> <td height="auto" colspan="2" valign="top" bgcolor="#FFFFFF" style="padding:10px;" class="copyclass" id=copy2298>open_basedir = "e:/web/;C:/WINDOWS/TEMP/;"

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

<table width="620" align="center" border="0" cellpadding="1" cellspacing="1" style="background:#FB7"> <tr> <td width="464" height="27" bgcolor="#FFE7CE"> 代码如下</td> <td width="109" align="center" bgcolor="#FFE7CE" style="cursor:pointer;" onclick="doCopy('copy8880')">复制代码</td> </tr> <tr> <td height="auto" colspan="2" valign="top" bgcolor="#FFFFFF" style="padding:10px;" class="copyclass" id=copy8880>

open_basedir = "e:web;C:WINDOWSTEMP;"

这样就解决了

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

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

您可能感兴趣的文章:
require,include和require_once,include_once 出现open_basedir错误
php文件调用与包含几个函数include_once() require_once()include()require()
PHP文件包含语句 include、include_once、require、require_onc
谈谈PHP中require和include的区别
php中的include,require,include_once,require_once
include,require,以及后缀加once的区别
php引入文件的方法有哪些
深入理解php中的echo()和print()、require()和include()
详解PHP中include与require的用法区别
php引入文件的四个方法

[关闭]
~ ~