5
votes

I installed Laravel and uploaded it to git now I downloaded it But when I'm trying to enter the site I get this error:

The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths.

I found this answer: The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths. laravel 5.3

My config/app.php

'key' => env('APP_KEY'),

'cipher' => env('APP_KEY'),

I run

php artisan key:generate

my ENV file:

APP_KEY=base64:zJQUL0Kuwhb2JL6L7IJ+1UO7IUSQSw2Td40F9LNABfE=

I run composer update

but still the same error... I tried to clear config and cache it but that didn't help.

What else can I do?

4

4 Answers

7
votes

Your config/app.php is wrong, change the cipher entry to 'cipher' => 'AES-256-CBC'. You have key and cipher both pointing to the same .env variable.

1
votes

The correct way of resolving this is as follows: php artisan key:generate (Note the generated base 64 key)

php artisan config:cache

Check the .env file and confirm that the value of APP_KEY is equal to the value you noted during key:generate

Thats it!!

1
votes

php artisan key:generate fixed for me . You can check the .env to be sure the APP_KEY get assigned a base64 value

0
votes

APP_KEY cipher if AES-256-CBC is selected, the length must be 32 characters.

'key' => env('APP_KEY'),

'cipher' => 'AES-256-CBC',

APP_KEY=base64:iT7PDx7j8yKVTj0AW81vTnEQmqLwnVfW    => 32 characters