1

I am using php 7.3.2 on window 7. When I try to run php artisan serve, it shows this error on the webpage:

Whoops, looks like something went wrong.

Is it related to the message that I received when I want to migrate database, it says

Application In Production!

My error in laravel log shows

production.ERROR: RuntimeException: The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths. in C:\xampp\htdocs\Inventory\vendor\laravel\framework\src\Illuminate\Encryption\Encrypter.php:43

Isaac Bennetch
  • 11,830
  • 2
  • 32
  • 43
irham dollah
  • 169
  • 13
  • Please post the relating error in your `storage/logs/laravel.log` file – ege Nov 27 '19 at 10:08
  • The error shows `production.ERROR: RuntimeException: The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths. in C:\xampp\htdocs\Inventory\vendor\laravel\framework\src\Illuminate\Encryption\Encrypter.php:43` – irham dollah Nov 27 '19 at 10:11
  • You need to add a secret key. See below answer – ege Nov 27 '19 at 10:15

2 Answers2

3

Following the error in your log file you seem to be missing your key attribute in your .env file. See this SO question for a solution.

To generate the secret key, run

$ php artisan key:generate

make sure to follow the official docs when installing Laravel.

ege
  • 774
  • 5
  • 19
0

Your laravel is running in production mode. If you are developing local, you should switch that for your local maschine.

To do so: In your .env set the APP_ENV to local (APP_ENV=local) and try again.

Now, you will see the full error message and you are able to handle it now.

Paladin
  • 1,637
  • 13
  • 28