gpt4 book ai didi

laravel - mkdir() : No such file or directory - laravel

转载 作者:行者123 更新时间:2023-12-02 13:46:48 40 4
gpt4 key购买 nike

我想创建一个目录,但出现此错误:

ErrorException in Filesystem.php line 390: mkdir(): No such file or directoryErrorException in Filesystem.php line 390: mkdir(): No such file or directory


in Filesystem.php line 390
at HandleExceptions->handleError('2', 'mkdir(): No such file or directory', 'C:\xampp\htdocs\yatan\yatan\vendor\laravel\framework\src\Illuminate\Filesystem\Filesystem.php', '390', array('path' => 'C:\xampp\htdocs\yatan\yatan\public/assets/images/projects/1/1476592434/', 'mode' => '511', 'recursive' => false, 'force' => false))

我的代码:

    $to_main_image = time();
$path = 'assets/images/projects/'.$user_id.'/'.$to_main_image.'/';
File::makeDirectory(public_path().'/'.$path,0777);

最佳答案

换行

File::makeDirectory(public_path().'/'.$path,0777);

File::makeDirectory(public_path().'/'.$path,0777,true);

这样子目录也被创建了。

关于laravel - mkdir() : No such file or directory - laravel,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40066884/

40 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com