• Register
0 votes
154 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

Please log in or register to answer this question.

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 3 views
3 views
Problem: I tried to find out the solution on the web when I face this problem but I did not get any fruitful information that I can continue if you read the above question and understand what is the solution of this please cooperate with me- Thanks
asked Mar 23 shamimkhan 15.1k points
0 votes
1 answer 6 views
6 views
Problem: How to correct this error > class 'collective\html\htmlserviceprovider' not found
asked Mar 24 Azlan2020 2.3k points
0 votes
1 answer 4 views
4 views
Problem: when I try to install tensorflow by cloning from git, I run into the error "no module named copyreg," so I tried installing using a virtualenv. However, I then run into this error: Tensorflow is not a supported wheel on this platform I don't see this under the common problems section, so any help would be appreciated! Thank you.
asked Mar 21 ummesalma 22k points
0 votes
1 answer 780 views
780 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 2 views
2 views
Problem: I am stuck with this ... Please help me that how to deal with this? How to fix encryption unsuccessful in android?
asked 3 days ago Ifra 24.4k points
0 votes
1 answer 4 views
4 views
Problem: Unable to get MacPort functionality after installing Xcode 4.3. How do i trouble shoot my Xcode and MacPort interface?
asked Mar 15 ummesalma 22k points
0 votes
1 answer 5 views
5 views
Problem: how to Solve this: error: 3.11 program: painting a wall (python 3) HELP! I need help understanding this: 3.11 program: painting a wall (python 3) Can someone please help solve this, I am new in python(). Someone have idea to solve this thanks!
asked Mar 13 Mashhoodch 13k points
0 votes
2 answers 1.1K views
1.1K views
Problem : Currently I am using the Python 3.3 and I have only entered these 3 below lines: import sklearn as sk import numpy as np import matplotlib.pyplot as plt But I am facing below error: “SyntaxError: multiple statements found while compiling a single statement” What is wrong with my Python code?
asked Jan 14, 2020 jwilliam 3.9k points
0 votes
1 answer 168 views
168 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, 2020 Raphael Pacheco 4.9k points