Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

laravel install getting key generate error in ubunto OS

I am install "Laravel Framework version 5.2.26" but i am getting error for key generate in my ubuntu os

user@CN43:/var/www/html/laravel_1$ php artisan key:generate

  [ErrorException]                                                             
  file_get_contents(/var/www/html/laravel_1/.env): failed to open stream: No   
  such file or directory

So i have check that directory .env file is not there but .env.example file only there so i created that file and update database name, database username, database password after that "php artisan key:generate" command is worked that key was generated above 32 characters and its get [base64:somethingsstrings with above 32 characters] i think some installation issues is there.

my laravel site is not opening. what i do mistake?

like image 386
Balaguru Murugan Avatar asked Mar 29 '16 06:03

Balaguru Murugan


2 Answers

Run this command and make .env file from .env.example file:

cp .env.example .env
php artisan key:generate

Now it's generate the key. Don't create new .env file.

like image 136
Hiren Gohel Avatar answered Sep 20 '22 18:09

Hiren Gohel


Rename .env.example to .env and fill all properties.

If you install Laravel via Composer, this file will automatically be renamed to .env. Otherwise, you should rename the file manually

https://laravel.com/docs/5.0/configuration#environment-configuration

like image 30
Alexey Mezenin Avatar answered Sep 19 '22 18:09

Alexey Mezenin