• Register
0 votes
115 views

Problem :

I have recently installed a new fresh copy of laravel 5.3 using composer but I keep getting following error:

The only supported ciphers are AES-128-CBC and AES-256-CBC with the correct key lengths. Even though my app.php file in config directory specify
'cipher' => 'AES-128-CBC',

6 5 3
7,540 points

2 Answers

0 votes

Solution :

I have lots of industry experience in writing complex code.I have gone through your post and understood your problem.Please follow below approach to resolve your issue:.

To begin with you must ensure first that you have a valid .env file which you can use in the terminal by copying the existing .env.example file as following:

$ cp .env.example .env

After that you need to generate your application Key by using following command:

$ php artisan key:generate

Once this is achieved please make sure that you open your .env file and also ensure that the APP_KEY looks correct as follows:

APP_KEY=base64:MsUJo+qAhIVGPx52r1mbxCYn5YbWtCx8FQ7pTaHEvRo=base64:Ign7MpdXw4FMI5ai7SXXiU2vbraqhyEK1NniKPNJKGY=

If  observed carefully you will notice that the key length is wrong for some unknown reason maybe because of running key : generate multiple times it has two base64= keys present there. So just Removing one is the fix to your problems. I was also having and this appears to be an Artisan/Laravel bug.

Hope this answer helps you or who may be struggling with the similar problems or annoying bug

9 7 4
38,600 points
0 votes

Solution:

You require to have .env on your appication folder then run:

$ php artisan key:generate

In case you don't have .env copy from .env.example:

$ cp .env.example .env

Run php artisan key:generate.

Do php artisan config:clear,

Thereafter php artisan config:cache

And things will begin performing

Run this commands on your terminal:

php artisan config:clear
After
php artisan config:cache

In case you are running a Laravel project for the first time in that machine ensure that you have the required requirements. Open your CMD/Terminal in your project directory or

cd to/your/project/dir

Provide this command again:

composer update

Alter your .env.example to .env and make required changes in that file particularly database configurations to avoid db error. Then

php artisan key:generate

This resolves this AES cipher key length issue each time I make a Laravel project or clone it from git.

Follow These Steps:

Step 1: Ensure that you have .env file in your application. In case not run this command cp .env.example .env

Step 2: Now run following command ( php artisan key:generate ) to produced a key and it will obtain saved in .env file automatically.

Step 3: Run php artisan config:cache in case you want to cache the configurtration Or php artisan config:clear

run this command

php artisan key:generate

and the clear config cache using

php artisan config:cache

 

10 6 4
31,120 points

Related questions

0 votes
1 answer 35 views
35 views
Problem: I have very recently downloaded the Graphviz 2.38 MSI version then installed it under folder C:\Python34. Next step I ran pip install Graphviz everything went well. In my system's path I have also added C:\Python34\bin. When I tried to run my ... I also tried to uninstall my Graphviz and did pip uninstall graphviz then tried reinstalling it and pip install again still nothing is working.
asked Aug 28 Raphael Pacheco 4.9k points
0 votes
1 answer 475 views
475 views
Problem : I am running Laravel 5.4 on my Homestead vagrant box but when I want to run npm run production I am getting the following error block-scoped declarations (let, const, function, class) not yet supported outside strict mode.
asked Nov 14, 2019 peterlaw 6.9k points
0 votes
1 answer 43 views
43 views
Problem : Facing migration error on Laravel 5.4 with php artisan make:auth command as follows: syntax error or access violation: 1071 specified key was too long; max key length is 767 bytes
asked Nov 13, 2019 peterlaw 6.9k points
0 votes
1 answer 1.7K views
1.7K views
Problem : I got stuck on below error I am trying to configure my SMTP mail on laravel “Expected response code 250 but got code "530", with message "530 5.7.1 authentication required "” Below is the configuration on .env MAIL_DRIVER=smtp MAIL_HOST=smtp.mailtrap.io ... I have tried to authenticate my SMTP on the env but I keep facing the above error so for now I am stuck on that error.
asked Feb 4 jwilliam 3.9k points
1 vote
1 answer 21 views
21 views
Problem: I am getting an error message: windows error 2 occurred while loading the java VM I was just wondering if anyone had seen this kind of error before and if so, how to solve it. The very few answers I can find online relate to this issue. Somebody please step ahead and pull me up. Thanks
asked Mar 26 Gavin 15.3k points