How to resolve the error "[ErrorException] file_get_contents(/var/www/laravel/.env): failed to open stream: No such file or directory"?

Rename .env.example to .env in your laravel root folder


The .env file is not yet present because you will first need to create and configure it.

Do the following

# Navigate to the correct folder
$ cd /var/www/laravel

# Copy the example file to make a .env file
$ cp .env.example .env

# Set the parameters
$ vi .env

Rename .env.example to .env and fill all properties. https://laravel.com/docs/5.0/configuration#environment-configuration