Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel project missing .env file

I'm new to laravel and i recently pulled a project from git-hub and it wouldn't run because it's missing the .env file i tried composer install but that didn't work. Is there any other way to generate the .env file?

like image 326
Yohannes Taye Avatar asked Aug 20 '16 11:08

Yohannes Taye


People also ask

Where is .env file in Laravel project?

In a fresh Laravel installation, the root directory of your application will contain a .env.example file that defines many common environment variables.

What is use of .env file in Laravel?

. env file, as its name suggest, is a local where you put all your environment setup, such as database credentials, cache drivers and etc. Everything that is about the server that the project is running, and may have different values for different servers, are setup here.


2 Answers

You can download the standard env.example file from the Laravel source code, rename it to .env and edit it. Just set up correct DB credentials, etc.

Don't forget to run the php artisan key:generate command which will generate an application (encryption) key and add it to the .env file.

like image 96
Alexey Mezenin Avatar answered Nov 16 '22 03:11

Alexey Mezenin


Just open an editor and create an .env file. Its a simple Text File.

And its ignored by git, because it contains sensitive data.

Edit: Normally there should be an .env.example file it the folder (which is not ignored by git by default), you can rename it to .env

like image 34
derdida Avatar answered Nov 16 '22 02:11

derdida