Wednesday, October 17, 2018

Solution To: Laravel Error file_get_contents(/var/www/laravel/.env): failed to open stream

.
PROBLEM:

file_get_contents(/var/www/laravel/.env)
: failed to open stream
: No such file or directory”?

SOLUTION:
Probably you missed your .env file in laravel project folder.So make .env.example to .env file. Also give the required database connection.

.envfile look like this: (Fill up with required database connection)

APP_ENV=local
APP_DEBUG=true
APP_KEY=SomeRandomString
APP_URL=http://localhost

DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret

CACHE_DRIVER=file
SESSION_DRIVER=file
QUEUE_DRIVER=sync

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
.
REFERENCE:
https://stackoverflow.com/questions/36761778/how-to-resolve-the-error-errorexception-file-get-contents-var-www-laravel-e

1 comment:

  1. This is really an awesome article. Thank you for sharing this.It is worth reading for everyone.
    Hire PHP Database Development

    ReplyDelete

Labels