php只好在本地服务器网站跟目录创建目录吗?不能在其它盘创建吗
php只能在本地服务器网站跟目录创建目录吗?不能在其它盘创建吗?
- PHP code
<!-- 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($dir_handle=@opendir($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. 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
------解决方案--------------------
你这个是各种错,路径不对,权限不对,自己检查清楚.
你是虚拟主机?

熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

Video Face Swap
使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

熱工具

記事本++7.3.1
好用且免費的程式碼編輯器

SublimeText3漢化版
中文版,非常好用

禪工作室 13.0.1
強大的PHP整合開發環境

Dreamweaver CS6
視覺化網頁開發工具

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)

使用Java的File.length()函數取得檔案的大小檔案大小是在處理檔案作業時很常見的一個需求,Java提供了一個很方便的方法來取得檔案的大小,即使用File類別的length()方法。本文將介紹如何使用此方法來取得檔案的大小,並給出對應的程式碼範例。首先,我們需要建立一個File物件來表示我們想要取得大小的檔案。以下是建立File物件的方法:Filef

想了解更多關於開源的內容,請造訪:51CTO鴻蒙開發者社群https://ost.51cto.com運行環境DAYU200:4.0.10.16SDK:4.0.10.15IDE:4.0.600一、建立應用程式點擊File- >newFile->CreateProgect。選擇模版:【OpenHarmony】EmptyAbility:填寫項目名,shici,應用包名com.nut.shici,應用儲存位置XXX(不要有中文,特殊字符,空格)。 CompileSDK10,Model:Stage。 Device

使用Java的File.renameTo()函數重命名檔案在Java程式設計中,我們經常需要對檔案進行重命名的操作。 Java提供了File類別來處理檔案操作,其中的renameTo()函數可以方便地重新命名檔案。本文將介紹如何使用Java的File.renameTo()函數來重新命名文件,並提供對應的程式碼範例。 File.renameTo()函數是File類別的一個方法,

function是函數的意思,是一段具有特定功能的可重複使用的程式碼區塊,是程式的基本組成單元之一,可以接受輸入參數,執行特定的操作,並傳回結果,其目的是封裝一段可重複使用的程式碼,提高程式碼的可重複使用性和可維護性。

使用java的File.getParent()函數取得檔案的父路徑在Java程式設計中,我們經常需要操作檔案和資料夾。有時候,我們需要取得一個檔案的父路徑,也就是該檔案所在資料夾的路徑。 Java的File類別提供了getParent()方法用來取得檔案或資料夾的父路徑。 File類別是Java對檔案和資料夾的抽象表示,它提供了一系列操作檔案和資料夾的方法。其中,get

JavaAPI開發中使用Jetty7進行Web伺服器處理隨著互聯網的發展,Web伺服器已經成為了應用程式開發的核心部分,同時也是許多企業所關注的焦點。為了滿足日益增長的業務需求,許多開發人員選擇使用Jetty進行Web伺服器開發,其靈活性和可擴展性受到了廣泛的認可。本文將介紹如何在JavaAPI開發中使用Jetty7進行We

表單驗證是Web應用程式開發中非常重要的環節,它能夠在提交表單資料之前對資料進行有效性檢查,避免應用程式出現安全漏洞和資料錯誤。使用Golang可以輕鬆實現網頁應用程式的表單驗證,本文將介紹如何使用Golang來實作網頁應用程式的表單驗證。一、表單驗證的基本要素在介紹如何實作表單驗證之前,我們需要知道表單驗證的基本要素是什麼。表單元素:表單元素是指

Web標準是一組由W3C和其他相關組織制定的規範和指南,它包括HTML、CSS、JavaScript、DOM、Web可訪問性和性能優化等方面的標準化,透過遵循這些標準,可以提高頁面的兼容性、可訪問性、可維護性和效能。 Web標準的目標是使Web內容能夠在不同的平台、瀏覽器和裝置上一致地展示和交互,提供更好的使用者體驗和開發效率。
