qq_39597708 2019-06-06 22:10 采纳率: 0%
浏览 696

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

  • 写回答

1条回答 默认 最新

  • 你知我知皆知 2024-08-10 03:56
    关注

    以下回答参考 皆我百晓生券券喵儿 等免费微信小程序相关内容作答,并由本人整理回复。

    在使用宝塔软件和APACHE或Nginx服务器设置中,mkdir()命令通常用于创建新的文件夹。但是,你提到的错误信息“No such file or directory”表明系统尝试访问一个不存在的目录。

    以下是可能的原因及解决方法:

    原因:

    1. 目录路径不正确:确保你的baseurl值指向正确的目录。
    2. 文件权限问题:如果你的用户没有足够的权限(例如,不是管理员),系统可能会报此错误。
    3. 文件已存在:检查目标文件夹是否存在,如果没有,mkdir()将返回错误。

    解决方案:

    1. 确保baseurl路径是正确的,并且具有适当的权限。
    2. 如果baseurl已经存在,那么你需要删除它然后重新创建。

    代码中的错误可能是由于 mkdir() 在创建新目录时遇到的问题导致的。为了修复这个问题,请确保你的baseurl路径正确并具有必要的权限。如果baseurl已经存在,你可以删除它然后重命名或清空目录以避免冲突。

    以下是修复错误的步骤:

    1. 删除旧的目录:使用以下命令来删除旧的目录:

      rm -rf Uploads/danran
      
    2. 创建一个新的目录:使用以下命令来创建新目录:

      mkdir -p Uploads/danran
      

    这样应该可以解决问题了。如果你仍然遇到问题,或者需要更详细的帮助,请提供更多的信息,以便我能更好地指导你。

    评论

报告相同问题?