PHP はローカルサーバーの Web サイトとディレクトリにディレクトリを作成する必要がありますか?別のディスクに作成できないのでしょうか?
Jun 13, 2016 pm 01:22 PM
file
function
quot
web
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
------解决方案--------------------
你这个是各种错,路径不对,权限不对,自己检查清楚.
你是虚拟主机?
このウェブサイトの声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。

人気の記事
スプリットフィクションを打ち負かすのにどれくらい時間がかかりますか?
3週間前
By DDD
レポ:チームメイトを復活させる方法
3週間前
By 尊渡假赌尊渡假赌尊渡假赌
ハローキティアイランドアドベンチャー:巨大な種を手に入れる方法
3週間前
By 尊渡假赌尊渡假赌尊渡假赌
2つのポイント博物館:すべての展示とそれらを見つける場所
3週間前
By 尊渡假赌尊渡假赌尊渡假赌

人気の記事
スプリットフィクションを打ち負かすのにどれくらい時間がかかりますか?
3週間前
By DDD
レポ:チームメイトを復活させる方法
3週間前
By 尊渡假赌尊渡假赌尊渡假赌
ハローキティアイランドアドベンチャー:巨大な種を手に入れる方法
3週間前
By 尊渡假赌尊渡假赌尊渡假赌
2つのポイント博物館:すべての展示とそれらを見つける場所
3週間前
By 尊渡假赌尊渡假赌尊渡假赌

ホットな記事タグ

メモ帳++7.3.1
使いやすく無料のコードエディター

SublimeText3 中国語版
中国語版、とても使いやすい

ゼンドスタジオ 13.0.1
強力な PHP 統合開発環境

ドリームウィーバー CS6
ビジュアル Web 開発ツール

SublimeText3 Mac版
神レベルのコード編集ソフト(SublimeText3)

ホットトピック
Gmailメールのログイン入り口はどこですか?
7125
9


Java チュートリアル
1534
14


Laravel チュートリアル
1256
25


PHP チュートリアル
1205
29


CakePHP チュートリアル
1153
46



JavaのFile.length()関数を使用してファイルのサイズを取得します。

JavaのFile.renameTo()関数を使用してファイルの名前を変更する

JavaのFile.getParentFile()関数を使用してファイルの親ディレクトリを取得します。

Golang を使用して Web アプリケーションのフォーム検証を実装する方法

JavaのFile.getParent()関数を使用してファイルの親パスを取得します。
