Thursday, March 2, 2017

Trouble running Laravel 5 Server. "Whoops, looks like something went wrong." http://127.0.0.1:8000/

I decided to commit to learning PHP and I had TONS of trouble installing Laravel on Ubuntu but I am finally up and running. However, whenever I run php artisan serve I get this page.

I think I may have changed the host file, but not sure. I don't quite understand the host files or where do access them. Nonetheless, in NodeJS, when creating an Express JS server, we used to do something like app.listen(3000); but I don't see where Laravel is getting the URL.

I also tried php artisan key:generate but it says

  [ErrorException]                                                             
  file_get_contents(/home/user/Documents/laraveltut/.env): failed to o  
  pen stream: No such file or directory 

even though I have changed the .env.example to .env. This is what my .env file looks like.

APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost

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

BROADCAST_DRIVER=log
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

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=

It's just overwhelming because I am following a tutorial that has a slightly lower version, but I can't get anything working. Not to mention, I haven't even go ahold of VirtualBox or Vagrant whatever those are.



via dsomel21

Advertisement