在上传文件时,我用了file_exists()函数,代码如下:
if(file_exists($_FILES['upfile']['tmp_name'])){
   echo "AAAAAAAAAAAAAAAAAAa";
}
使用了这个函数后,居然报了个错:
Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(F:\wamp\tmp\php17A.tmp) is not within the allowed path(s): (F:\wamp\www\demo;c:\windows\temp) in F:\wamp\www\demo\index.php on line 56排除错误,$_FILES['upfile']['tmp_name']是有值的;
看了网上很多资料,都说是open_basedir权限设置问题,但我搜了好多资料,也学着改了,可是还是报这个错误,改前与改后没什么反应;
我用的是集成环境——WAMP5,应该怎么改啊?要详细的哟

解决方案 »

  1.   

    php.ini 里改 open_basedir, 加你的目录就行了
      

  2.   

    设置你php.ini的open_basedir+入你允许访问的目录即可!
      

  3.   

    上传的临时文件F:\wamp\tmp\php17A.tmp在F:\wamp\tmp目录,而open_basedir只允许F:\wamp\www\demo;c:\windows\temp目录,所以出错,你可以把你的F:\wamp\tmp目录加到open_basedir允许的里面