php - Laravel Sail 无法运行 artisan migrate

标签 php laravel laravel-8

我已经成功安装了带有 Sail 的 Laravel,应用程序很好,我可以使用 sail up 运行它。但是我无法迁移数据库,每次运行 sail artisan migrate 都会抛出以下错误。

There is no existing directory at "/home/dariel/www/2021/nsmart/storage/logs" and it could not be created: Permission denied

  at vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:172
    168▕             set_error_handler([$this, 'customErrorHandler']);
    169▕             $status = mkdir($dir, 0777, true);
    170▕             restore_error_handler();
    171▕             if (false === $status && !is_dir($dir)) {
  ➜ 172▕                 throw new \UnexpectedValueException(sprintf('There is no existing directory at "%s" and it could not be created: '.$this->errorMessage, $dir));
    173▕             }
    174▕         }
    175▕         $this->dirCreated = true;
    176▕     }

      +10 vendor frames 
  11  [internal]:0
      Illuminate\Foundation\Bootstrap\HandleExceptions::handleException()

我被困在这一点上,任何帮助将不胜感激。提前致谢。

最佳答案

你可以试试这个

php artisan route:clear;
php artisan config:clear;
php artisan cache:clear;
sail artisan migrate;

关于php - Laravel Sail 无法运行 artisan migrate,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66684936/

相关文章:

mysql - Laravel 查询多对多关系

php - 目标类 Controller 不存在 - Laravel 8

php - 如何修复 Laravel 8 UI 分页问题?

php - 单击提交按钮后显示文本。 PHP

php - 从 Laravel 4 中的事务中返回数据

php - Laravel - 发布请求空字段

php - 与 Laravel 8 上的 setKeysForSaveQuery() 覆盖不兼容的方法

javascript - 如何将值动态传递给图表

PHP PDO 防止数据重叠

PHP/MySQL - 不允许我插入(或替换)右单引号 "’ "