Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RuntimeException] No supported encrypter found. The cipher and / or key length are invalid. #4

Open
chotosite opened this issue Oct 6, 2019 · 5 comments

Comments

@chotosite
Copy link

chotosite commented Oct 6, 2019

When I try php artisan serve it says [RuntimeException] No supported encrypter found. The cipher and / or key length are invalid.

I also tried:
php artisan key:generate
composer update
composer install

But nothing is working

I have installed laravel 6.x. If I run laravel new blog everything is working fine.

@qlint
Copy link
Owner

qlint commented Oct 7, 2019

This project was built in Laravel 5. I'm not sure if Laravel is backward compatible - maybe that is where your problem is. What output do you get on composer install?

@chotosite
Copy link
Author

This is the output of composer install:
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Package phpoffice/phpexcel is abandoned, you should avoid using it. Use phpoffice/phpspreadsheet instead.
Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.
Generating autoload files
Carbon 1 is deprecated, see how to migrate to Carbon 2.
https://carbon.nesbot.com/docs/#api-carbon-2
You can run './vendor/bin/upgrade-carbon' to get help in updating carbon and other frameworks and libraries that depend on it.

Illuminate\Foundation\ComposerScripts::postInstall
php artisan optimize

[RuntimeException]
No supported encrypter found. The cipher and / or key length are invalid.

Script php artisan optimize handling the post-install-cmd event returned with error code 1

@hamza-gaya
Copy link

Nothing worked cipher is error is appearing in cmd of windows while entering the command php artisan serve

@abdelsalamshahlol
Copy link

This problem can be solved by doing the following:

1- Create .env in the root folder of the project and paste this placeholder code

APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:ST+O4okIRa/lJsN9f3Y29ggrCIeXC4dYyv5yDp7Zvl4=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=database
DB_USERNAME=root
DB_PASSWORD=

2 - Run php artisan key:generate in the console
3 - Install project dependencies composer install

@nil-borad
Copy link

**Note ** Delete Vendor Folder From cloned directory to be sure

  1. Copy Env File From Another Application (make necessary changes)
  2. php artisan key:generate
  3. composer install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants