1
0

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 1 year has passed since last update.

「The stream or file ~ could not be opened in append mode」の対処法

Posted at

はじめに

DockerでLaravelの環境構築中に、「The stream or file ~ could not be opened in append mode」というエラーが出て困っていたので対処法をまとめます。

--
環境:Docker version 24.0.7

問題

PHPコンテナ内でLaravelプロジェクトを作成。

$ docker compose exec php bash
$ composer create-project --prefer-dist "laravel/laravel=" .

そして上のようにプロジェクト内にLaravelのソースコードを書き、動作確認をしようとブラウザを開くと…

the stream.png

The stream or file "/var/www/html/storage/logs/laravel.log" could not be opened in append mode: Failed to open stream: Permission denied

このようなエラーが表示されました。

解決方法

storage/logs/laravelにappendする権限が与えられていないので、パーミッションを変更してあげます。

$ chmod -R 777 /app/storage/

参考

1
0
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?