7

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.

sepehr
  • 17,110
  • 7
  • 81
  • 119
Fabian
  • 71
  • 1
  • 2

3 Answers3

0

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?

Roj Vroemen
  • 1,853
  • 12
  • 11
  • The console command php artisan key:generate does not generate an error and the key is automatically being added to the .env file. Nevertheless If I access the environment I get: RuntimeException in EncryptionServiceProvider.php line 45: No supported encrypter found. The cipher and / or key length are invalid. – Fabian Mar 30 '16 at 17:58
  • What's your cipher set to, should be `AES-256-CBC`. I've gotten errors like that when the cipher isn't set right or when the storage isn't writable – Tom Bird Nov 11 '16 at 03:32
0

put this in appServiceProvider.php

use Illuminate\Support\Facades\Schema;
public function boot()
{
    Schema::defaultStringLength(191);
}
Ali Baig
  • 39
  • 3
-5

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.