9

I'm having problem starting my laravel installation. Whenever I type in the terminal php artisan serve, it throws me an error like below:

c:\wamp\www\blog>php artisan serve Laravel development server started on http://localhost:8000/

[Sat Nov 05 21:18:39 2016] Failed to listen on localhost:8000 (reason: An attempt was made to access a socket in a way forbidden by its access permissions.)

4
  • If you're using wamp, why do you need to use artisan serve? Just serve the content through wamp.
    – Devon
    Nov 6 '16 at 3:27
  • Can you tell me in which OS are you working? Nov 6 '16 at 4:04
  • To clearify, WAMP is a webserver, php artisan serve will also run a web server. It's generally not recommended to be using both. Use only 1 at the time. Also seeing this is laravel, I would recommend using something like vagrant and homestead. If you run Windows 10 check this link to get it fully working. youtube.com/watch?v=S3kaQDFJiis&t=187s
    – killstreet
    Nov 6 '16 at 14:52
  • 2 possibilities I can think of, something is already listening on port 8000, or possibly a firewall or antivirus preventing it from listening on the port. Nov 7 '16 at 16:15
14

1) First firewall restore to default

2) change artisan serve port using this command php artisan serve --port=3232

Trust me its works :)

0
2

I faced the same problem today. I just restarted the my machine, after that tried with the same port and it works!

1
  • It(Restarting) works for me too. Though it seems strange behavior. Dec 27 '20 at 15:47
1

Change artisan serve port using this command

php artisan serve --port=#### 

instead #### you can enter your own port number.

This will work sure.!

1

You need command prompt to run as administrator, that solves the problem most of the time.

0

First make sure your installed Laravel properly in your local machine.
When you execute php artisan serve , you better to run it with administrative priviledges.
In linux, I use
sudo php artisan localhost:8888 -t public


Make sure other requirements such as php version are upto date.

PHP >= 5.5.9
OpenSSL PHP Extension
PDO PHP Extension
Mbstring PHP Extension
Tokenizer PHP Extension

For more information refer this document.

1
  • 4
    It's generally not recommended or necessary to run a web server as a superuser.
    – Devon
    Nov 6 '16 at 3:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.