Laravel 5.2: Artisan key generation for application key not working properly

I am trying to install Laravel 5.2 on CentOS 7. When I try to generate the Application Key using the php artisan key:generate console command, the Application Key format is not as expected (longer than 32 characters, including the base64 encoding string, and therefore does not work in the configuration file. Cypher in config / app.php - AES-256-CBC.

Result:

 [base64:MTs0+UZ0tHljmRcFP1RpZ06aYpc1N1L3rqAx1FT+yqk=] 

All necessary extensions must be installed on the server.

+6
source share
3 answers

This is a recent key generator change. See this commit for more information.

Do you get an error that the key is invalid?

0
source

put this in appServiceProvider.php

 use Illuminate\Support\Facades\Schema; public function boot() { Schema::defaultStringLength(191); } 
0
source

I do not know if you have resolved this issue. This is how I decided the same.

In config / app.php, remove env () and its brackets from the key.

eg. 'key' => env ('your_key')

should change it to ..

'key' => 'your_key'

I hope this helps you and others there.

-4
source

All Articles