Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Artisan Error: Failed to listen on localhost:8000

I'm having a problem starting my laravel installation. Whenever I type in the terminal 'php artisan serve' it responses me an error:

Failed to listen on localhost:8000 (reason:une tentative d'access un α socket de maniere interdite par ses autorisation d'access a 0t0 tent0e)

any ideas on how to solve this?

thanks in advance.

img problem http://i.imgur.com/rOt3Lat.png

it's working now I just changed the listen port from 8000 to 8888 or any other port your services didn't use it

'php artisan serve --port="8888"'

like image 868
byacer Avatar asked Jan 12 '15 10:01

byacer


5 Answers

Fixing Error: Failed to listen on localhost:8000 (reason: Address already in use)

List processes with php in it

ps -ef | grep php

Example output

501  **9347**     393    0  1:29PM ttys000    0:00.21 php artisan serve
501    9351    **9347**  0  1:29PM ttys000    0:02.01 /usr/local/php5-5.6.14-20151002-085853/bin/php -S localhost:8000 .../laravel/server.php
501    9781       393    0  1:56PM ttys000    0:00.00 grep php

Then kill the process

kill -9 9347

like image 87
mayorsanmayor Avatar answered Oct 17 '22 09:10

mayorsanmayor


Are there any other services running on port 8000?

You can use this command on Windows:

netstat -aon | more

or on Linux / OSX

sudo netstat -plnt

to see what services are running. Then disable the service that is running on port 8000 or use another port.

like image 44
Koen van den Heuvel Avatar answered Oct 17 '22 08:10

Koen van den Heuvel


List process using ps -ef | grep php

Then below only works for me

kill -9 9347

which is a force kill of the process

501  9347   393   0  1:29PM ttys000    0:00.21 php artisan serve

Option 2:

If above not works, Change the default laravel serve port number if you can, like

php artisan serve --port=8088
like image 42
Hemamalini Avatar answered Oct 17 '22 09:10

Hemamalini


8000 is the default port. Use instead of :

php artisan serve --port=8005
like image 10
Nadim Tareq Avatar answered Oct 17 '22 07:10

Nadim Tareq


It is because something already running on that port and you can change the port by command itself, by running following command

php artisan serve --port 8001
like image 4
Shahrukh Anwar Avatar answered Oct 17 '22 09:10

Shahrukh Anwar