LoginSignup
1
1

More than 5 years have passed since last update.

Laravel nginx 500 エラー!

Posted at

php artisan serveで動くコードがnginxで500エラー :scream:
nginxのログを調べた結果、下記の様なエラーが発生。

PHP message: PHP Fatal error:  Uncaught UnexpectedValueException: The stream or file "/XXXXX/laravel/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied in /XXXX/laravel/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:87

ファイル権限周りか!php-fpmの設定を見たら、実行するユーザはwww-data, ユーザwww-dataはlaravel.logファイルを書き込み権限がなし!権限設定忘れ。。。

Laravel DocのDirectory Permissionsを見ると、権限設定について説明がある。やはりDocの勉強不足!

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