• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

php只好在本地服务器网站跟目录创建目录吗?不能在其它盘创建吗

php 搞代码 3年前 (2022-01-24) 13次浏览 已收录 0个评论

php只能在本地服务器网站跟目录创建目录吗?不能在其它盘创建吗?

PHP code

<!---ecms Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--><?php    function copyDir($dirSrc,$dirTo){        if(is_file($dirTo)){            echo "目标不是目录不能创建";            return ;        }        if(!file_exists($dirTo)){            mkdir($dirTo);        }                if([email protected]($dirSrc)){            while ($filename = readdir($dir_handle)){                if($filename != "." && $filename != ".."){                    $subSrcFile = $dirSrc."\\".$filename;                    $subToFile = $dirTo."\\".$filename;                                        if(is_dir($subSrcFile)){                        copyDir($subSrcFile,$subToFile);                    }                    if(is_file($subSrcFile)){                        copy($subSrcFile,$subToFile);                    }                }            }            closedir($dir_handle);        }    }    copyDir("myphp","D:\\admin");?>

把盘符去了,就可以创建。不知道为什么不到copy到其它盘
加盘符就会出现错误
如:Warning: is_file() [function.is-file]: open_basedir restriction in effect. File(D:\admin) is not within the allowed path(s): (E:\web) in E:\web\copyFile.php on line 3

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(D:\admin) is not within the allowed path(s): (E:\web) in E:\web\copyFile.php on line 7

Warning: mkdir() [function.mkdir]: open_basedir restriction in effect. File(D:\admin) is not within the allowed path(s): (E:\web) in E:\web\copyFile.php on line 8

Warning: is_file() [function.is-file]: open_basedir restriction in effect. File(D:\admin\file) is not within the allowed path(s): (E:\web) in E:\web\copyFile.php on line 3

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect.

2本文来源gao!daima.com搞$代!码网

搞代gaodaima码 File(D:\admin\file) is not within the allowed path(s): (E:\web) in E:\web\copyFile.php on line 7

Warning: mkdir() [function.mkdir]: open_basedir restriction in effect. File(D:\admin\file) is not within the allowed path(s): (E:\web) in E:\web\copyFile.php on line 8

Warning: copy() [function.copy]: open_basedir restriction in effect. File(D:\admin\file\wo.txt) is not within the allowed path(s): (E:\web) in E:\web\copyFile.php on line 21

Warning: copy(D:\admin\file\wo.txt) [function.copy]: failed to open stream: Operation not permitted in E:\web\copyFile.php on line 21

Warning: copy() [function.copy]: open_basedir restriction in effect. File(D:\admin\in.txt) is not within the allowed path(s): (E:\web) in E:\web\copyFile.php on line 21

Warning: copy(D:\admin\in.txt) [function.copy]: failed to open stream: Operation not permitted in E:\web\copyFile.php on line 21

——解决方案——————–
你这个是各种错,路径不对,权限不对,自己检查清楚.
你是虚拟主机?


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:php只好在本地服务器网站跟目录创建目录吗?不能在其它盘创建吗

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址