Birju088
Birju088

Reputation: 93

Cipher and / or key length are invalid [EncryptionServiceProvider] Laravel5

First time laravel5 run after install composer Cipher and / or key length are invalid [EncryptionServiceProvider] error in Laravel5 ?

Upvotes: 0

Views: 535

Answers (2)

Prakash Bhandari
Prakash Bhandari

Reputation: 567

I think you have some key generation problem. You can generate the keys by following below simple steps.

  1. Add an APP_KEY by running php artisan key:generate from the command line in your project root. This will generate a random, 32 character string which is used for encryption.

  2. You should already have 'cipher' => 'AES-256-CBC', within your project_directory/config/app.php.

  3. Run the project. This might work.

Happy Coding :)

Upvotes: 1

Birju088
Birju088

Reputation: 93

Simply, Beginner in laravel5..
when you are install composer in laravel project after error "Cipher and / or key length are invalid [EncryptionServiceProvider]" solved

  1. open project directory and run there laravel composer

  2. in composer command->php artisan key:generate
    you see this type of key generate [gcVkEsRcFdjcsYVFuZee8yOLfiRZl1VE]. Copy this key

  3. open project_directory/config/app.php

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

paste that key which see in bold letter replace with new generate key remove '[]' must be...

Upvotes: 3

Related Questions