mkdir():许可Laravel

我正在运行以下脚本,以便在服务器中上传图像并在完美运行时收到以下错误 本地主机。 </ p>

代码</ strong> </ p>

  $ user_id = Auth :: id(); 
$ logicpath ='userdp /'。 $ user_id。 '/';
$ pubpath ='userdp /'。 $ user_id。 '/'。 $ dpFile;
$ path ='/ userdp /'。 $ user_id。 '/'。 $ dpFile;

if(!file_exists($ logicpath)){
mkdir($ logicpath,0777,true);
}
</ code> </ pre>

错误</ strong> </ p>


UploadController.php第605行中的ErrorException:mkdir():权限
被拒绝</ p>

at HandleExceptions-&gt; handleError('2','mkdir():Permission denied',
'/var/www/html/laravel/app/Http/Controllers/UploadController.php',
'605',array( 'dp'=&gt; object(UploadedFile),'ext'=&gt;'jpg','img'=&gt;
object(图片),'mime'=&gt;'image / jpeg','width'= &gt;'200','height'=&gt;
'200','fileSize'=&gt;'17152','dpFile'=&gt;
'f12f298ab18d58a59c4ed8a589cd1cdc.jpg','user_id'=&gt;'1 ','logicpath'
=&gt;'userdp / 1 /','pubpath'=&gt;'userdp / 1 / f12f298ab18d58a59c4ed8a589cd1cdc.jpg','path'=&gt;
'/userdp/1/f12f298ab18d58a59c4ed8a589cd1cdc.jpg '))</ p>
</ blockquote>

我尝试了 chmod 777 public </ code>并重新启动了服务器。 但它没有用。 </ p>
</ div>

展开原文

原文

I'm running the following script for an image upload in a server and getting the following error while it works perfectly on the localhost.

Code

$user_id = Auth::id();
$logicpath = 'userdp/' . $user_id . '/';
$pubpath = 'userdp/' . $user_id . '/' . $dpFile;
$path = '/userdp/' . $user_id . '/' . $dpFile;

if (!file_exists($logicpath)) {
     mkdir($logicpath, 0777, true);
}

Error

ErrorException in UploadController.php line 605: mkdir(): Permission denied

at HandleExceptions->handleError('2', 'mkdir(): Permission denied', '/var/www/html/laravel/app/Http/Controllers/UploadController.php', '605', array('dp' => object(UploadedFile), 'ext' => 'jpg', 'img' => object(Image), 'mime' => 'image/jpeg', 'width' => '200', 'height' => '200', 'fileSize' => '17152', 'dpFile' => 'f12f298ab18d58a59c4ed8a589cd1cdc.jpg', 'user_id' => '1', 'logicpath' => 'userdp/1/', 'pubpath' => 'userdp/1/f12f298ab18d58a59c4ed8a589cd1cdc.jpg', 'path' => '/userdp/1/f12f298ab18d58a59c4ed8a589cd1cdc.jpg'))

I tried chmod 777 public and restarted the server. But it didn't work.

doubei2340
doubei2340 永远不要给你的根文件夹777权限。它为专业黑客的安全漏洞。请尝试绑定严格的安全规则,并仅为组/用户分配所需的权限/权限。
大约 3 年之前 回复
duanpang2751
duanpang2751 你应该使用755而不是777。
接近 5 年之前 回复

6个回答



您必须递归执行chmod以确保所有子目录也具有相同的权限。 请尝试运行此代码:</ p>

  chmod -R 777 
</ code> </ pre>

现在虽然这样可以解决您的问题,但您应该 肯定会阅读设置上述权限时出现的问题,因为此链接在下面的评论中显示。 我也会在这里发帖:</ p>

http://stackoverflow.com/a/11271632/2790481 </ p>

编辑:这应该只在 / var / www / html / laravel / storage </ code>中的Laravel存储目录中完成,例如,从不 在系统级别完成。 我最初忘了提到这一点,因此都是所有的downvotes。</ p>
</ div>

展开原文

原文

You have to perform chmod recursively to make sure all subdirectories also carry the same permissions. Try running this instead:

chmod -R 777 

Now while this will fix your issue, you should definitely read up on the problems that arise with setting the above permissions as this link posted in comments below shows. Ill post here as well:

http://stackoverflow.com/a/11271632/2790481

EDIT: This should only be done within the Laravel storage dir within /var/www/html/laravel/storage, for example and never be done at the system level. I forgot to mentioned that originally, hence all the downvotes.

dtyyrt4545
dtyyrt4545 这可能会破坏整个系统
一年多之前 回复
douguan3470
douguan3470 小心这个命令:服务器如何通过chmod 777变得容易受到攻击
4 年多之前 回复



您正在尝试将上传的文件移动到服务器根目录中的文件夹中。 确保你获得正确的绝对路径。</ p>

  $ logicpath = public_path()。  '/ userdp /'。  $ user_id。  '/'; 
</ code> </ pre>
</ div>

展开原文

原文

You are trying to move the uploaded file a folder in the root of your server. Make sure you get the absolute path right.

$logicpath = public_path() . '/userdp/' . $user_id . '/';

dongzhong5756
dongzhong5756 您还需要递归地chmod userdp:chmod -R 755 public / userdp
接近 5 年之前 回复
dongwei1263
dongwei1263 我试过这个并没有工作。
接近 5 年之前 回复



尝试:</ p>

  sudo chown -R www-data:www-data /  var / www / yoursite / public 
</ code> </ pre>
</ div>

展开原文

原文

Try:

sudo chown -R www-data:www-data /var/www/yoursite/public




我尝试了chmod 777 public并重新启动了服务器。 但它不起作用。</ p>
</ blockquote>

请确保以递归方式使用CHMOD并具有管理员权限(如果可以的话)</ p>

  SUDO CHMOD -R 777 / var / www / html / laravel / 
</ code> </ pre>

问候</ p>
</ div>

展开原文

原文

I tried chmod 777 public and restarted the server. But it didn't work.

Be sure you use the CHMOD recursively and with administrator permissions (if you can)

SUDO CHMOD -R 777 /var/www/html/laravel/

Regards



我找到了一个非常有趣的解决方案。 只要把“。” 像这个例子一样签名。 这个对我有用。 </ p>

  $ destinationPath =“。/ public / uploads”;  //上传路径
if(!file_exists($ destinationPath)){
mkdir($ destinationPath,0755,true);
}
$ request-&gt; sub_category_attr_value-&gt; move($ destinationPath,$ picName) ;
</ code> </ pre>
</ div>

展开原文

原文

I have found a very interesting solution to this problem. Just put "." sign like this example. It works for me.

$destinationPath = "./public/uploads"; // upload path
    if (!file_exists($destinationPath)) {
      mkdir($destinationPath, 0755, true);
    }
    $request->sub_category_attr_value->move($destinationPath, $picName);



命令的错误</ p>

  composer create-project --prefer-dist  laravel / laravel MyProject 
</ code> </ pre>

但它在以下命令之后起作用</ p>

  sudo mkdir MyProject 

sudo chmod -R 777 MyProject
</ code> </ pre>

或者更好地将composer create-project命令运行到某些与htdocs不同的路径</ strong> </ p>
</ DIV>

展开原文

原文

Same error for the command

composer create-project --prefer-dist laravel/laravel MyProject

But it worked after the following commands

sudo mkdir MyProject

sudo chmod -R 777 MyProject

Or better run composer create-project command to some different path than htdocs

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
在路径上找不到文件:在laravel 5.6上

<div class="post-text" itemprop="text"> <p>i am using laravel 5.6, i will try to make function multiple upload video, and get frame and duration with laravel-ffmpeg, but when i try to upload one video for example, always show error like "File not found at path:", </p> <p>this is my function to store video and get duration &amp; frame :</p> <pre><code>public function doCreate($lessonsid) { if (empty(Session::get('contribID'))) { return redirect('contributor/login'); } # code... // validate // read more on validation at http://laravel.com/docs/validation $rules = array( 'judul' =&gt; 'required', // 'video.*' =&gt; 'mimes:mp4,mov,ogg,webm |required|max:100000', // 'image.*' =&gt; 'mimes:jpeg,jpg,png,gif|required|max:30000' ); $validator = Validator::make(Input::all(), $rules); // process the login if ($validator-&gt;fails()) { return redirect()-&gt;back()-&gt;withErrors($validator)-&gt;withInput(); } else { $now = new DateTime(); $cid = Session::get('contribID'); $title = Input::get('judul'); $image_video = Input::file('image'); $lessons_video = Input::file('video'); // dd($lessons_video); // $media = FFMpeg::open('https:/dev.cilsy.id/assets/source/lessons/lessons-74/video-8/1. Introduction (2).mp4'); // $frame = $media-&gt;getFrameFromString('00:00:13.37'); // dd($media); $description = Input::get('desc'); $video=Video::where('lessons_id',$lessonsid)-&gt;get(); $count_video=count($video); if (!is_dir("assets/source/lessons/lessons-$lessonsid")) { $newforder=mkdir("assets/source/lessons/lessons-".$lessonsid); } $i=$count_video + 1; foreach ($title as $key =&gt; $titles) { $type_video =$lessons_video[$key]-&gt;getMimeType(); if (!is_dir("assets/source/lessons/lessons-".$lessonsid."/video-".$i)) { $newforder=mkdir("assets/source/lessons/lessons-".$lessonsid."/video-".$i); } $DestinationPath= 'assets/source/lessons/lessons-'.$lessonsid.'/video-'.$i; //insert image if(!empty($image_video[$key])){ $imagefilename = $image_video[$key]-&gt;getClientOriginalName(); $image_video[$key]-&gt;move($DestinationPath, $imagefilename); }else{ $imagefilename = ''; } if($imagefilename ==''){ $url_image= $imagefilename; }else{ $urls=url(''); $url_image= $urls.'/assets/source/lessons/video-'.$i.'/'.$imagefilename; } //insert video if(!empty($lessons_video[$key])){ $lessonsfilename = $lessons_video[$key]-&gt;getClientOriginalName(); $lessons_video[$key]-&gt;storeAs($DestinationPath, $lessonsfilename); }else{ $lessonsfilename = ''; } if($lessonsfilename ==''){ $url_video= $lessonsfilename; }else{ $urls=url(''); $url_video= $urls.'/assets/source/lessons/video-'.$i.'/'.$lessonsfilename; } $store = new Video; $store-&gt;lessons_id = $lessonsid; $store-&gt;title = $titles; $store-&gt;image = $url_image; $store-&gt;video = $url_video; $store-&gt;description = $description[$key]; $store-&gt;type_video = $type_video; $store-&gt;durasi = 0; $store-&gt;created_at = $now; $store-&gt;enable=1; $store-&gt;save(); if($store){ $media = FFMpeg::open($url_video); // $frame = FFMpeg::open($link) // -&gt;getFrameFromSeconds(10) // -&gt;export() // -&gt;toDisk('public') // -&gt;save($filename.'.png'); dd($media); $durationInSeconds = $media-&gt;getDurationInSeconds(); // dd($media); } $i++; } // Session::set('lessons_title',$title); // Session::set('lessons_category_id',$category_id); // Session::set('lessons_image',$image); // Session::set('lessons_description',$description); return redirect('contributor/lessons/'.$lessonsid.'/view')-&gt;with('success','Penambahan video berhasil'); } } </code></pre> <p>this is message error, when i try to upload my video</p> <p><a href="https://i.stack.imgur.com/2Rz1m.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2Rz1m.png" alt="error display"></a></p> <p>anyone can help me?</p> </div>

PHP mkdir:权限被拒绝的问题

<div class="post-text" itemprop="text"> <p>I am trying to create a directory with PHP mkdir function but I get an error as follows: <code>Warning: mkdir() [function.mkdir]: Permission denied in ...</code>. How to settle down the problem?</p> </div>

Laravel的Storage :: makeDirectory返回mkdir:invalid参数

<div class="post-text" itemprop="text"> <p>So I'm trying to create a new directory in <code>C:/..../public/videos</code> folder when somebody uploads a video, using the following code: </p> <pre><code>if ($request-&gt;hasFile('video')) { $newDir = public_path('videos\\' . $story-&gt;story_id); Storage::makeDirectory( $newDir, 0755, true); $request-&gt;file('video')-&gt;move($newDir); } </code></pre> <p>But I get this error:</p> <blockquote> <p>ErrorException in Local.php line 350: mkdir(): Invalid argument in Local.php line 350 at HandleExceptions-&gt;handleError('2', 'mkdir(): Invalid argument', 'C:\xampp\htdocs\qanda2\vendor\league\flysystem\src\Adapter\Local.php', '350', array('dirname' =&gt; 'C:\xampp\htdocs\qanda2\public\videos\31', 'config' =&gt; object(Config), 'location' =&gt; 'C:\xampp\htdocs\qanda2\storage\app\C:\xampp\htdocs\qanda2\public\videos\31', 'umask' =&gt; '0', 'visibility' =&gt; 'public')) at mkdir('C:\xampp\htdocs\qanda2\storage\app\C:\xampp\htdocs\qanda2\public\videos\31', '493', true) in Local.php line 350 at Local-&gt;createDir('C:\xampp\htdocs\qanda2\public\videos\31', object(Config)) in Filesystem.php line 259 at Filesystem-&gt;createDir('C:\xampp\htdocs\qanda2\public\videos\31') in FilesystemAdapter.php line 276</p> </blockquote> <p>It seems like makeDirectory automatically adds <code>C:\xampp\htdocs\qanda2\storage\app\</code> in front of my path. </p> <p>Is there any workaround for this? I've been struggling with this for a while now and I can't find anything about this issue.</p> </div>

Zephir教程错误

<div class="post-text" itemprop="text"> <p>I try to apply <a href="http://zephir-lang.com/tutorial.html" rel="nofollow">http://zephir-lang.com/tutorial.html</a> .I run this code in my desktop(text_ext directory).</p> <pre><code>zephir init utils cd utils </code></pre> <p>and <code>zephir build</code> results are:</p> <pre><code>baris@ubuntu:~/Desktop/test_ext/utils$ zephir build Preparing for PHP compilation... Preparing configuration file... shtool:mkdir:Error: invalid number of arguments (at least 1 expected) shtool:mkdir:Hint: run `./build/shtool mkdir -h' or `man shtool' for details Compiling... Installing... Extension installed! Add extension=utils.so to your php.ini Don't forget to restart your web server </code></pre> <p><code>php -v</code> command</p> <pre><code>PHP 5.5.8-3+sury.org~saucy+2 (cli) (built: Jan 29 2014 13:30:11) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies with Zend OPcache v7.0.3-dev, Copyright (c) 1999-2013, by Zend Technologies </code></pre> <p>In result, "utils.so" is not created.</p> </div>

linux系统创建文件报Read-only file system

创建文件夹时提示: mkdir 1 mkdir: cannot create directory `1': Read-only file system

Hadoop -mkdir /user不能创建目录

本人刚开始学习Hadoop,使用 Hadoop -mkdir /user 指令时,提示错误为: Unrecognized option: -mkdir Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. 这是什么原因,为什么说不能识别-mkdir,不知道我那个地方错了,求大神们指点一下。谢谢!

在具有777权限的目录中尝试mkdir()时,我获得了权限被拒绝

<div class="post-text" itemprop="text"> <p>When running</p> <pre><code>$id = mysqli_num_rows($resultSelect) + 1; $uploadDir = "/projects/$id/"; mkdir($uploadDir,0777,true); </code></pre> <p>I get the errors</p> <pre><code>Warning: mkdir() [function.mkdir0]: Permission denied in /var/www/devx.online/html/php/newProject.php on line 9 </code></pre> <p>The directory is owned by www-data and the group is www-data. The permissions is 777 for testing, and even still permissions are denied. I am running Ubuntu 18.04 LTS with Apache2.</p> </div>

osxfuse cgofuse mkdir输入/输出错误

<div class="post-text" itemprop="text"> <p>while using <a href="https://github.com/billziss-gh/cgofuse" rel="nofollow noreferrer">cgofuse</a> i cant create dir inside mounted fs with os.Mkdir: </p> <blockquote> <p>panic: mkdir mp/testDir: input/output error</p> </blockquote> <p>Code:</p> <pre><code>import ( "fmt" "os" "path/filepath" "syscall" "github.com/billziss-gh/cgofuse/fuse" ) type Ptfs struct { fuse.FileSystemBase root string } var ( dirName = "testDir" ) func main() { mountPoint = os.Args[1] fs := Ptfs{} host := fuse.NewFileSystemHost(&amp;fs) host.SetCapReaddirPlus(true) go host.Mount(mountPoint, []string{"-d"}) defer host.Unmount() fmt.Println("init completed...") fmt.Scanln() fmt.Println("make dir...") err := os.Mkdir(filepath.Join(mountPoint, dirName), 0700) if err != nil { panic(err) } } </code></pre> <p>Getattr definition for cgofuse is next (almost same as in example from github):</p> <pre><code>func (self *Ptfs) Getattr(path string, stat *fuse.Stat_t, fh uint64) (errc int) { stgo := syscall.Stat_t{} if ^uint64(0) == fh { path = filepath.Join(self.root, path) errc = errno(syscall.Lstat(path, &amp;stgo)) } else { errc = errno(syscall.Fstat(int(fh), &amp;stgo)) } return } func (self *Ptfs) Mkdir(path string, mode uint32) (errc int) { path = filepath.Join(self.root, path) return errno(syscall.Mkdir(path, mode)) } </code></pre> <p>giving the "-d" mount options i get this additional output:</p> <blockquote> <p>make dir... unique: 9, opcode: LOOKUP (1), nodeid: 1, insize: 48, pid: 27053 LOOKUP /testDir getattr /testDir unique: 9, error: -2 (No such file or directory), outsize: 16 unique: 7, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 27053 getattr / unique: 7, success, outsize: 136 unique: 2, opcode: DESTROY (38), nodeid: 1, insize: 40, pid: 27053 unique: 2, success, outsize: 16</p> </blockquote> <p>dir "testDir" inside root dir in mountpoint isnt exist yet, so i guess "No such file or directory" is okay for this. But even after "success" of GETATTR of "root" dir i still can't create dir. Opcode DESTROY i believe gets by unmounting of system caused by defer host.Unmount().</p> <p>[EDIT] Diving deeper: func syscall.Lstat() is used from Getattr():</p> <pre><code>func Lstat(path string, stat *Stat_t) (err error) { var _p0 *byte _p0, err = BytePtrFromString(path) if err != nil { return } _, _, e1 := Syscall(SYS_LSTAT64, uintptr(unsafe.Pointer(_p0)), uintptr(unsafe.Pointer(stat)), 0) if e1 != 0 { err = errnoErr(e1) } return } </code></pre> </div>

用nvm 安装nodeV0.12.0版本时报权限不足

nvm install v0.12.0 安装时报权限不足, ------------------------------------------------------------------- mkdir: cannot create directory ‘/home/ubuntu/.nvm/bin’: Permission denied grep: /home/ubuntu/.nvm/bin/node-v0.12.0-linux-x64/node-v0.12.0-linux-x64.tar.gz: No such file or directory Binary download failed, trying source. mkdir: cannot create directory ‘/home/ubuntu/.nvm/src’: Permission denied nvm: install v0.12.0 failed! 但是前面加了sudo 会直接报 sudo: nvm: command not found ------------------------------------------------------------------- sudo: nvm: command not found

mkdir(): No such file or directory 报错 求详细修改教程,小白,宝塔软件 APACHE环境

[2] ErrorException in Wechat.php line 28 mkdir(): No such file or directory public function __construct($config=array()) { $this->wxconfig=$config;//关注时回复anywn $this->share=$config; $this->keyset=$config;//关键词列表anywn $this->config= $config; $this->siren=$config; $this->baseurl = "Uploads/".$config["appid"]; if(!is_dir($this->baseurl)) {mkdir($this->baseurl,'0777');} $this->request=Request::instance(); } public function testaa(){ print_r('testa');exit; } public function openmsg($wx) { Call Stack in Wechat.php line 28 at Error::appError(2, 'mkdir(): No such fil...', '/www/wwwroot/saolei/...', 28, ['config' => ['name' => 'danran', 'logo' => 'http://wx.ye33w.cn/g...', 'cdnurl' => '', ...]]) at mkdir('Uploads/wx74ef6c0095...', '0777') in Wechat.php line 28 at Wechat->__construct(['name' => 'danran', 'logo' => 'http://wx.ye33w.cn/g...', 'cdnurl' => '', ...]) in User.php line 43 at User->_initialize() in Controller.php line 59 at Controller->__construct(object(Request)) at ReflectionClass->newInstanceArgs([object(Request)]) in App.php line 359 at App::invokeClass('app\index\controller...') in Loader.php line 479 at Loader::controller('user', 'controller', false, 'Error') in App.php line 581 at App::module(['index', 'user', 'wxlog'], ['app_host' => '', 'app_debug' => '1', 'app_trace' => '', ...], null) in App.php line 457 at App::exec(['type' => 'module', 'module' => ['index', 'user', 'wxlog']], ['app_host' => '', 'app_debug' => '1', 'app_trace' => '', ...]) in App.php line 139 at App::run() in start.php line 19 at require('/www/wwwroot/saolei/...') in index.php line 18

警告:mkdir():文件存在[关闭]

<div class="post-text" itemprop="text"> <p>The file transferring to my upload folder is working well but I have a warning in <em>mkdir</em>. It says file exist but the picture and folder generates own name. I don't know what warning is determining. </p> <p>Anyone can help me?</p> <pre><code>include('connect.php'); $dir=substr(uniqid(),-7); // Uniqid for subdirectory $path = "uploads/$dir/"; // uploads/subdirectory/ // Make directory $valid_formats = array("jpg", "png", "jpeg", "kml"); $max_file_size = 2097152; $count = 0; // Loop $_FILES to execute all files if(!empty($_FILES)){ foreach($_FILES['files']['name'] as $f =&gt; $name) { if ($_FILES['files']['error'][$f] == 4) { continue; // Skip file if any error found } if ($_FILES['files']['error'][$f] == 0) { if ($_FILES['files']['size'][$f] &gt; $max_file_size) { $message[] = "$name is too large!."; continue; // Skip large files } elseif( ! in_array(pathinfo($name, PATHINFO_EXTENSION), $valid_formats) ){ $message[] = "$name is not a valid format"; continue; // Skip invalid file formats } else{ // No error found! Move uploaded files mkdir($path, 0700); $ext = pathinfo($_FILES['files']['name'][$f], PATHINFO_EXTENSION); $uniq_name = substr(uniqid(),-5) . '.' .$ext; $dest = $path . $uniq_name; if(move_uploaded_file($_FILES["files"]["tmp_name"][$f], $dest)){ $qry = "INSERT INTO files (code, name, path, type) VALUES ('$dir','$uniq_name','$dest','$ext')" ; $result = mysqli_query($dbc, $qry); if ( false===$result ) { $sql_error .= 'Error in the query '.$qry.' Error Desc :'.mysqli_error($dbc).'&lt;br /&gt;&lt;br /&gt;' ; } } } } }} </code></pre> </div>

错误:mkdir…文件名,目录名称或卷标签语法不正确

<div class="post-text" itemprop="text"> <p>I am using <code>postgres_exporter</code> for <code>prometheus</code>, and when I am trying to run it it shows me an error:</p> <blockquote> <p>Error: failed to run "go-bindata -pkg=assets -o assets/bindata.go -ignore=bindata.go -ignore=.*.map$ -prefix=assets/generated assets/generated/...: exec: "go-bindata": executable file not found in %PATH%" exit status 1</p> </blockquote> <p>I realised that I had the wrong library of go-bindata installed. So after I installed the other one, error has changed to :</p> <blockquote> <p>Error: mkdir C:\Users\StarTech\go\src\github.com\wrouesnel\postgres_exporter\bin/C:: The filename, directory name, or volume label syntax is incorrect. exit status 1</p> </blockquote> <p>This is the link of <code>postgres_exporter</code>: <a href="https://github.com/wrouesnel/postgres_exporter" rel="nofollow noreferrer">postgres_exporter</a></p> <p>First i type these commands:</p> <pre><code>go get github.com/wrouesnel/postgres_exporter cd path/src/github.com/wrouesnel/postgres_exporter go run mage.go export DATA_SOURCE_NAME="postgresql://login:password@hostname:port/dbname" ./postgres_exporter &lt;flags&gt; </code></pre> <p>Also i am using <code>run</code> command instead of <code>export</code> since I'm on Windows.</p> <p>And error happens when I type command <code>go run mage.go docker</code></p> </div>

在安装PHP时,我在Cygwin中执行mkdir之后遇到了'缺少操作数'

<div class="post-text" itemprop="text"> <p>While attempting to make sure that <code>$CVSROOT</code> existed, I executed</p> <pre><code>mkdir $CVSROOT </code></pre> <p>only to find the error:</p> <blockquote> <p>'missing operand'</p> </blockquote> </div>

使用mkdir(),未创建目录

<div class="post-text" itemprop="text"> <pre><code>$ad_title = $_POST['title']; $ad_content = $_POST['content-ads']; $ad_region = $_POST['region']; if (!is_dir("uploads/".$ad_region)) { // dir doesn't exist, make it mkdir("uploads/".$ad_region); echo "directory created!"; } else { echo "directory already exist!"; } </code></pre> <p>I am making a site and I am developing it in localhost for now. My <strong>save.php</strong> file and the <strong>uploads folders</strong> where the codes above is saved in the local directory </p> <pre><code>localhost/system/modules/new/ </code></pre> <p>When I relocated the <strong>save.php</strong> file and the <strong>uploads folder</strong> in the directory</p> <pre><code>localhost/system/ </code></pre> <p>all seems to be working now. But I want it to work in the </p> <pre><code>localhost/system/modules/new/ </code></pre> <p>directory for better organization. Any help on how to make it work?</p> </div>

`sudo pecl install couchbase`给出错误`错误:失败了mkdir / usr / local / Cellar / php / 7.3.8 / pecl / 20180731`

<div class="post-text" itemprop="text"> <p>I am setting up couchbase but when I try to install the Couchbase PHP extension by running the command <code>sudo pecl install couchbase</code> it fails with an error of <code>ERROR: failed to mkdir /usr/local/Cellar/php/7.3.8/pecl/20180731</code></p> </div>

消息:mkdir():codeigniter上的权限被拒绝

<div class="post-text" itemprop="text"> <p>i have error when creating folder by using <code>mkdir()</code> on my codeigniter getting this error:</p> <blockquote> <p>Message: mkdir(): Permission denied</p> </blockquote> <p>and this my code</p> <pre><code>$path = './upload_file/'; $idtrx = $_POST['id_trx']; $dir = $path.$idtrx; mkdir($dir,0777,TRUE); </code></pre> <p>can anyone helps me??</p> </div>

php mkdir()无法正常工作

<div class="post-text" itemprop="text"> <p>I can't seem to figure this out. I realize at this point that this just must be a simple syntax issue that is throwing me off, I'm fairly new to PHP so I am going to thank my noobiness for this one.</p> <p>I am trying to create subdirectories ($slugTitle) within already existing directories ($w_type), yet the directories are failing to be created.</p> <p>This is my code:</p> <pre><code> $path1 = "/".$w_type."/".$slugTitle; $path2 = "/".$w_type."/".$slugTitle."/images"; $mode = 0777; mkdir($path1); mkdir($path2); </code></pre> <p>I've also tried:</p> <pre><code> $path1 = "/".$w_type."/".$slugTitle; $path2 = "/".$w_type."/".$slugTitle."/images"; $mode = 0777; mkdir($path1,$mode,TRUE); mkdir($path2,$mode,TRUE); </code></pre> <p>and still now luck. Instead, I get directories that are named " instead of creating a directory within an already existing directory.</p> <p>Please help! Thank you!</p> <p>-Joshie</p> </div>

ubuntu下rvm安装ruby报错

错误如下,在线等,谢谢 rvm install ruby-2.2 Searching for binary rubies, this might take some time. No binary rubies available for: ubuntu/14.04/x86_64/ruby-2.2.1. Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies. Checking requirements for ubuntu. Installing requirements for ubuntu. mkdir: 无法创建目录"/usr/local/rvm/log/1443528316_ruby-2.2.1": 权限不够 tee: /usr/local/rvm/log/1443528316_ruby-2.2.1/update_system.log: 没有那个文件或目录 Updating systemfangshuxian password required for 'apt-get --quiet --yes update': ............ Error running 'requirements_debian_update_system ruby-2.2.1', showing last 15 lines of /usr/local/rvm/log/1443528316_ruby-2.2.1/update_system.log tail: 无法打开"/usr/local/rvm/log/1443528316_ruby-2.2.1/update_system.log" 读取数据: 没有那个文件或目录 Requirements installation failed with status: 1.

PHP mkdir():在docker卷中拒绝权限

<div class="post-text" itemprop="text"> <p>I'm a bit lost with owner and rights inside a docker container, and I need help regarding the creation of a folder.</p> <p>I'm mounting in a container a local directory <code>images</code>. When I launch a bash inside my container, here is the rules of my folder:</p> <p><code>drwxrwxr-x 2 1000 1000 4096 Apr 24 21:43 images</code></p> <p>My php code tries to create a folder:</p> <pre><code>$prodid = mysqli_insert_id($conn); $targetDir = "../../theme/modules/products/images/".$prodid."/"; $oldumask = umask(0); mkdir($targetDir, 0755); </code></pre> <p>But I receive this error:</p> <pre><code>Warning : mkdir(): Permission denied in /var/www/html/modules/product/product_new.php </code></pre> <p>I suppose the owner of this folder should be <code>www-data:www-data</code> (and not even sure about that), so I tried to add in my dockerfile:</p> <pre><code>FROM php:7.3-apache ... RUN chown www-data:www-data /var/www/html/theme/modules/products/images </code></pre> <p>and my docker-compose:</p> <pre><code>version: "2" services: www: build: . ports: - "80:80" volumes: - ./www/.htaccess:/var/www/html/.htaccess - ./www/lib:/var/www/html/lib - ./www/modules:/var/www/html/modules - ./www/theme:/var/www/html/theme - ./www/index.php:/var/www/html/index.php - product-images:/var/www/html/theme/modules/products/images links: - db networks: - default db: image: mariadb:10.2 volumes: - ./dump:/docker-entrypoint-initdb.d - mariadb-data:/var/lib/mysql networks: - default phpmyadmin: image: phpmyadmin/phpmyadmin links: - db:db ports: - 8001:80 volumes: mariadb-data: product-images: </code></pre> <p>Rules are set, error is gone, but the folder is not created. i don't know what should be the ower/group or rights for this folder to allow php to create a folder.</p> <p>When I <code>docker-inspect</code> the volume:</p> <pre><code>docker inspect arcadust_product-images [ { "CreatedAt": "2019-07-30T15:45:31+02:00", "Driver": "local", "Labels": null, "Mountpoint": "/var/lib/docker/volumes/arcadust_product-images/_data", "Name": "arcadust_product-images", "Options": {}, "Scope": "local" } ] </code></pre> <p>What am I doing wrong?</p> </div>

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

Vue + Spring Boot 项目实战(十九):Web 项目优化解决方案

快来一起探索如何打脸我们的破项目,兄弟姐妹们把害怕打在公屏上!

你连存活到JDK8中著名的Bug都不知道,我怎么敢给你加薪

CopyOnWriteArrayList.java和ArrayList.java,这2个类的构造函数,注释中有一句话 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 public ArrayList(Collection&lt;? ...

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

CSDN:因博主近期注重写专栏文章(已超过150篇),订阅博主专栏人数在突增,近期很有可能提高专栏价格(已订阅的不受影响),提前声明,敬请理解!

CSDN:因博主近期注重写专栏文章(已超过150篇),订阅博主专栏人数在突增,近期很有可能提高专栏价格(已订阅的不受影响),提前声明,敬请理解! 目录 博客声明 大数据了解博主粉丝 博主的粉丝群体画像 粉丝群体性别比例、年龄分布 粉丝群体学历分布、职业分布、行业分布 国内、国外粉丝群体地域分布 博主的近期访问每日增量、粉丝每日增量 博客声明 因近期博主写专栏的文章越来越多,也越来越精细,逐步优化文章。因此,最近一段时间,订阅博主专栏的人数增长也非常快,并且专栏价

一个HashMap跟面试官扯了半个小时

一个HashMap能跟面试官扯上半个小时 关注 安琪拉的博客 1.回复面试领取面试资料 2.回复书籍领取技术电子书 3.回复交流领取技术电子书 前言 HashMap应该算是Java后端工程师面试的必问题,因为其中的知识点太多,很适合用来考察面试者的Java基础。 开场 面试官: 你先自我介绍一下吧! 安琪拉: 我是安琪拉,草丛三婊之一,最强中单(钟馗不服)!哦,不对,串场了,我是**,目...

我说我不会算法,阿里把我挂了。

不说了,字节跳动也反手把我挂了。

记录下入职中软一个月(外包华为)

我在年前从上一家公司离职,没想到过年期间疫情爆发,我也被困在家里,在家呆着的日子让人很焦躁,于是我疯狂的投简历,看面试题,希望可以进大公司去看看。 我也有幸面试了我觉得还挺大的公司的(虽然不是bat之类的大厂,但是作为一名二本计算机专业刚毕业的大学生bat那些大厂我连投简历的勇气都没有),最后选择了中软,我知道这是一家外包公司,待遇各方面甚至不如我的上一家公司,但是对我而言这可是外包华为,能...

面试:第十六章:Java中级开发

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

培训班出来的人后来都怎么样了?(二)

接着上回说,培训班学习生涯结束了。后面每天就是无休止的背面试题,不是没有头脑的背,培训公司还是有方法的,现在回想当时背的面试题好像都用上了,也被问到了。回头找找面试题,当时都是打印下来天天看,天天背。 不理解呢也要背,面试造飞机,上班拧螺丝。班里的同学开始四处投简历面试了,很快就有面试成功的,刚开始一个,然后越来越多。不知道是什么原因,尝到胜利果实的童鞋,不满足于自己通过的公司,嫌薪水要少了,选择...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

工作八年,月薪60K,裸辞两个月,投简历投到怀疑人生!

近日,有网友在某职场社交平台吐槽,自己裸辞两个月了,但是找工作却让自己的心态都要崩溃了,全部无果,不是已查看无回音,就是已查看不符合。 “工作八年,两年一跳,裸辞两个月了,之前月薪60K,最近找工作找的心态崩了!所有招聘工具都用了,全部无果,不是已查看无回音,就是已查看不符合。进头条,滴滴之类的大厂很难吗???!!!投简历投的开始怀疑人生了!希望 可以收到大厂offer” 先来看看网...

大牛都会用的IDEA调试技巧!!!

导读 前天面试了一个985高校的实习生,问了他平时用什么开发工具,他想也没想的说IDEA,于是我抛砖引玉的问了一下IDEA的调试用过吧,你说说怎么设置断点...

都前后端分离了,咱就别做页面跳转了!统统 JSON 交互

文章目录1. 无状态登录1.1 什么是有状态1.2 什么是无状态1.3 如何实现无状态1.4 各自优缺点2. 登录交互2.1 前后端分离的数据交互2.2 登录成功2.3 登录失败3. 未认证处理方案4. 注销登录 这是本系列的第四篇,有小伙伴找不到之前文章,松哥给大家列一个索引出来: 挖一个大坑,Spring Security 开搞! 松哥手把手带你入门 Spring Security,别再问密...

97年世界黑客编程大赛冠军作品(大小仅为16KB),惊艳世界的编程巨作

这是世界编程大赛第一名作品(97年Mekka ’97 4K Intro比赛)汇编语言所写。 整个文件只有4095个字节, 大小仅仅为16KB! 不仅实现了3D动画的效果!还有一段震撼人心的背景音乐!!! 内容无法以言语形容,实在太强大! 下面是代码,具体操作看最后! @echo off more +1 %~s0|debug e100 33 f6 bf 0 20 b5 10 f3 a5...

程序员是做全栈工程师好?还是专注一个领域好?

昨天,有位大一的同学私信我,说他要做全栈工程师。 我一听,这不害了孩子么,必须制止啊。 谁知,讲到最后,更确定了他做全栈程序员的梦想。 但凡做全栈工程师的,要么很惨,要么很牛! 但凡很牛的,绝不是一开始就是做全栈的! 全栈工程师听起来好听,但绝没有你想象的那么简单。 今天听我来给你唠,记得帮我点赞哦。 一、全栈工程师的职责 如果你学习编程的目的只是玩玩,那随意,想怎么学怎么学。...

不要再到处使用 === 了

我们知道现在的开发人员都使用 === 来代替 ==,为什么呢?我在网上看到的大多数教程都认为,要预测 JavaScript 强制转换是如何工作这太复杂了,因此建议总是使用===。这些都...

什么是a站、b站、c站、d站、e站、f站、g站、h站、i站、j站、k站、l站、m站、n站?00后的世界我不懂!

A站 AcFun弹幕视频网,简称“A站”,成立于2007年6月,取意于Anime Comic Fun,是中国大陆第一家弹幕视频网站。A站以视频为载体,逐步发展出基于原生内容二次创作的完整生态,拥有高质量互动弹幕,是中国弹幕文化的发源地;拥有大量超粘性的用户群体,产生输出了金坷垃、鬼畜全明星、我的滑板鞋、小苹果等大量网络流行文化,也是中国二次元文化的发源地。 B站 全称“哔哩哔哩(bilibili...

十个摸鱼,哦,不对,是炫酷(可以玩一整天)的网站!!!

文章目录前言正文**1、Kaspersky Cyberthreat real-time map****2、Finding Home****3、Silk – Interactive Generative Art****4、Liquid Particles 3D****5、WINDOWS93****6、Staggering Beauty****7、Ostagram图片生成器网址****8、全历史网址*...

终于,月薪过5万了!

来看几个问题想不想月薪超过5万?想不想进入公司架构组?想不想成为项目组的负责人?想不想成为spring的高手,超越99%的对手?那么本文内容是你必须要掌握的。本文主要详解bean的生命...

用了这个 IDE 插件,5分钟解决前后端联调!

点击上方蓝色“程序猿DD”,选择“设为星标”回复“资源”获取独家整理的学习资料!作者 |李海庆我是一个 Web 开发前端工程师,受到疫情影响,今天是我在家办公的第78天。开发了两周,...

大厂的 404 页面都长啥样?最后一个笑了...

每天浏览各大网站,难免会碰到404页面啊。你注意过404页面么?猿妹搜罗来了下面这些知名网站的404页面,以供大家欣赏,看看哪个网站更有创意: 正在上传…重新上传取消 腾讯 正在上传…重新上传取消 网易 淘宝 百度 新浪微博 正在上传…重新上传取消 新浪 京东 优酷 腾讯视频 搜...

自从喜欢上了B站这12个UP主,我越来越觉得自己是个废柴了!

不怕告诉你,我自从喜欢上了这12个UP主,哔哩哔哩成为了我手机上最耗电的软件,几乎每天都会看,可是吧,看的越多,我就越觉得自己是个废柴,唉,老天不公啊,不信你看看…… 间接性踌躇满志,持续性混吃等死,都是因为你们……但是,自己的学习力在慢慢变强,这是不容忽视的,推荐给你们! 都说B站是个宝,可是有人不会挖啊,没事,今天咱挖好的送你一箩筐,首先啊,我在B站上最喜欢看这个家伙的视频了,为啥 ,咱撇...

代码注释如此沙雕,会玩还是你们程序员!

某站后端代码被“开源”,同时刷遍全网的,还有代码里的那些神注释。 我们这才知道,原来程序员个个都是段子手;这么多年来,我们也走过了他们的无数套路… 首先,产品经理,是永远永远吐槽不完的!网友的评论也非常扎心,说看这些代码就像在阅读程序员的日记,每一页都写满了对产品经理的恨。 然后,也要发出直击灵魂的质问:你是尊贵的付费大会员吗? 这不禁让人想起之前某音乐app的穷逼Vip,果然,穷逼在哪里都是...

Java14 新特性解读

Java14 已于 2020 年 3 月 17 号发布,官方特性解读在这里:https://openjdk.java.net/projects/jdk/14/以下是个人对于特性的中文式...

前端还能这么玩?(女朋友生日,用前端写了一个好玩的送给了她,高兴坏了)

前端还能这么玩?(女朋友生日,用前端写了一个好玩的送给了她,高兴坏了)

爬虫(101)爬点重口味的

小弟最近在学校无聊的很哪,浏览网页突然看到一张图片,都快流鼻血。。。然后小弟冥思苦想,得干一点有趣的事情python 爬虫库安装https://s.taobao.com/api?_ks...

工作两年简历写成这样,谁要你呀!

作者:小傅哥 博客:https://bugstack.cn 沉淀、分享、成长,让自己和他人都能有所收获! 一、前言 最近有伙伴问小傅哥,我的简历怎么投递了都没有反应,心里慌的很呀。 工作两年了目前的公司没有什么大项目,整天的维护别人的代码,有坑也不让重构,都烦死了。荒废我一身技能无处施展,投递的简历也没人看。我是不动物园里的猩猩,狒狒了! 我要加班,我要996,我要疯狂编码,求给我个机会… ...

相关热词 c# 解析cad c#数字格式化万 c#int转byte c#格式化日期 c# wpf 表格 c# 实现ad域验证登录 c#心跳包机制 c#使用fmod.dll c#dll vb 调用 c# outlook
立即提问
相关内容推荐