qlint / L5-HRMS

Laravel based human resource management system
48 stars 62 forks source link

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

Open chotosite opened 4 years ago

chotosite commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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

abdelsalamshahlol commented 3 years ago

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 commented 2 years ago

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