Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to listen on localhost:8000 (reason: Cannot assign requested address)

When I run php artisan serve on Ubuntu, the Laravel development server tries to start on http://localhost:8000/ but fails with this error:

[Mon Apr 25 10:28:08 2016] Failed to listen on localhost:8000 (reason: Cannot assign requested address)

My hosts file (/etc/hosts/):

1 27.0.0.1   localhost 

How can this be fixed?

like image 689
kn3l Avatar asked Jan 06 '23 04:01

kn3l


1 Answers

That's usually because the port is in already in use, or not available on the current host.

You can use this command to run php artisan serve --port=8080

like image 68
ganesh kalje Avatar answered Jan 08 '23 18:01

ganesh kalje