21
20

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Laravelの「There is no existing directory at "/Users/hoge/workspace/SamplePrpject/storage/logs" 」の解決方法

Last updated at Posted at 2020-02-10

##はじめに
Laravelのconfigファイルを修正後にphp artisan config:cacheを実行したら、表題のエラーが出たのでその際の解決方法を忘備録として残しておきます。

##開発環境

言語・FW     バージョン
Laravel 6.14.0
PHP 7.2.26

##エラーの内容

UnexpectedValueException

There is no existing directory at "/Users/hoge/workspace/SamplePrpject/storage/logs" and its not buildable: Permission denied

Monolog\Handler\StreamHandler::createDir:171
vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:171

##解決方法

初めにエラーログで指摘されている箇所が存在するか確認

$ cd storage/logs

存在する場合は、logsディレクトリの権限を確認
今回の場合は権限が777になっている

$ ll
drwxrwxrwx 4 user_name staff 128B 2 6 22:39 logs

キャッシュクリアの実行

$ php artisan cache:clear
$ php artisan route:clear
$ php artisan config:clear

自分の場合はキャッシュクリアを実行したら直りました。

21
20
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
21
20

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?