LoginSignup
30
17

More than 3 years have passed since last update.

Mac Laravel 500 server errorが出た話

Last updated at Posted at 2020-04-26

目的

  • 環境構築直後にローカル開発環境で500 server errorが出た話をまとめる

エラー概要

  • $ php artisan serveを実行してブラウザでhttp://127.0.0.1:8000/を確認したところ500 server error(下記のもの)が出力された。

    BC3D17BD-A681-4E81-A83F-B40391C770AA.png

解決法

  1. アプリ名ディレクトリを確認すると.envが存在していないことがわかった。
  2. 下記コマンドを実行して.envを作成する。

    $ cd アプリ名ディレクトリ
    $ cp .env.example .env
    
  3. laravelアプリを再起動してブラウザを確認したところ下記の画面が表示されていた。

    • アプリケーションを暗号化するためのキーがない、もしくは設定されていないらしい。

    479CDDAB-834B-4E21-B3AA-339B422263BE.png

  4. 下記コマンドを実行して鍵を作成した。

    $ php artisan key:generate
    >Application key set successfully.
    
  5. laravelアプリを再起動してブラウザを確認したところ下記の画面が表示されており、問題は解決した。

    38C8B2E5-0A42-40B6-9A96-6C978FD4DD91.png

30
17
1

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
30
17