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?
In a fresh Laravel installation, the root directory of your application will contain a .env.example file that defines many common environment variables.
. 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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With