Error-Laravel php Artisan

Asked

Viewed 449 times

1

I have this error in executing the command php artisan serve

RuntimeException in Encrypter.php line 43:
The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths.

in Encrypter.php line 43
at Encrypter->__construct('', 'AES-256-CBC') in EncryptionServiceProvider.php line 27
at EncryptionServiceProvider->Illuminate\Encryption\{closure}(object(Application), array()) in Container.php line 746
at Container->build(object(Closure), array()) in Container.php line 644
at Container->make('encrypter', array()) in Application.php line 709
at Application->make('encrypter') in Container.php line 864
at Container->resolveClass(object(ReflectionParameter)) in Container.php line 819
at Container->getDependencies(array(object(ReflectionParameter)), array()) in Container.php line 789
at Container->build('App\Http\Middleware\EncryptCookies', array()) in Container.php line 644
at Container->make('App\Http\Middleware\EncryptCookies', array()) in Application.php line 709
at Application->make('App\Http\Middleware\EncryptCookies') in Pipeline.php line 127
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 104
at Pipeline->then(object(Closure)) in Router.php line 655
at Router->runRouteWithinStack(object(Route), object(Request)) in Router.php line 629
at Router->dispatchToRoute(object(Request)) in Router.php line 607
at Router->dispatch(object(Request)) in Kernel.php line 268
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 46
at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 104
at Pipeline->then(object(Closure)) in Kernel.php line 150
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 117
at Kernel->handle(object(Request)) in index.php line 53
at require_once('C:\xampp\htdocs\pmo\public\index.php') in server.php line 21

I’ve already executed the command php artisan key:generate in the app.php file I copied the generated key and put in:

'key' => env('[base64:cDFjVAeEyMpey1sGdTBKKDAyY4ipZmOPVBeBpAsqQo4='),//

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

In part Cipher tbm I switched putting 128 and nothing .... I would like some hint about this problem.

  • https://github.com/laravel/framework/issues/9080

  • https://stackoverflow.com/questions/39693312/the-only-supported-ciphers-are-aes-128-cbc-and-aes-256-cbc-with-the-correct-key

  • 1

    There’s something wrong there, beast. You put [base64, doesn’t have that [ before...

  • well observed! @Wallacemaxters anyway... can not do this test ,to see if it would modify something, is just the observation.Thanks.

2 answers

0

To close the question, I just took a backup I had, and I did the procedure I always do and finally returned to normal.

And I looked in the file app.php and the part where I had problems... is like this key' => env('APP_KEY'), 'cipher' => 'AES-256-CBC',

-1

I had the same problem climbing up an Laravel Github project. I had the same error as: Runtimeexception in Encrypter.php line 43:

Running php Artisan key:generate worked perfectly.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.