Fabian
Fabian

Reputation: 71

Laravel 5.2: Artisan Key Generation for Application Key not working properly

I try to Setup Laravel 5.2 on CentOS 7. When I try to generate the Application Key using the console command php artisan key:generate the format of the Application Key is not as expected (longer than 32 characters including the base64 encode string and thus not working in the Configuration file.The cypher in config/app.php is AES-256-CBC.

Example Output:

[base64:MTs0+UZ0tHljmRcFP1RpZ06aYpc1N1L3rqAx1FT+yqk=]

The server should have all required Extensions installed.

Upvotes: 7

Views: 9507

Answers (3)

Ali Baig
Ali Baig

Reputation: 39

put this in appServiceProvider.php

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

Upvotes: 0

Gopal Panadi
Gopal Panadi

Reputation: 95

I dont know if you have resolved this issue.. This is how I solved the same.

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

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

should change it to..

'key' => 'your_key'

I hope this helps you and others out there.

Upvotes: -5

Roj Vroemen
Roj Vroemen

Reputation: 1892

This is a change made recently to the key generator. See this commit for more info.

Do you get an error stating that the key is invalid?

Upvotes: 0

Related Questions