laravel Artisan 错误:无法侦听 localhost:8000(原因:尝试以访问权限禁止的方式访问套接字。)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/40444810/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Artisan Error: Failed to listen on localhost:8000 (reason: An attempt was made to access a socket in a way forbidden by its access permissions. )
提问by buli.diriba
I'm having problem starting my laravel installation. Whenever I type in the terminal php artisan serve
, it throws me an error like below:
我在开始安装 Laravel 时遇到问题。每当我在终端中输入时php artisan serve
,它都会向我抛出如下错误:
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.)
c:\wamp\www\blog>php artisan serve Laravel 开发服务器启动在http://localhost:8000/
[Sat Nov 05 21:18:39 2016] 无法侦听 localhost:8000(原因:尝试以访问权限禁止的方式访问套接字。)
回答by nu1_ww
1) First firewall restore to default
1)首先将防火墙恢复为默认值
2) change artisan serve port using this command php artisan serve --port=3232
2)使用此命令更改工匠服务端口 php artisan serve --port=3232
Trust me its works :)
相信我它的作品:)
回答by Masood Anwar
You need command prompt to run as administrator, that solves the problem most of the time.
您需要以管理员身份运行命令提示符,这在大多数情况下可以解决问题。
回答by Pratik
I faced the same problem today. I just restarted the my machine, after that tried with the same port and it works!
我今天遇到了同样的问题。我刚刚重新启动了我的机器,然后尝试使用相同的端口并且它可以工作!
回答by Sachith Muhandiram
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 usesudo php artisan localhost:8888 -t public
首先确保您在本地机器上正确安装了 Laravel。
执行时php artisan serve
,最好使用管理权限运行它。
在linux中,我使用sudo php artisan localhost:8888 -t public
Make sure other requirements such as php version
are upto date.
确保其他要求(例如)php version
是最新的。
PHP >= 5.5.9
OpenSSL PHP Extension
PDO PHP Extension
Mbstring PHP Extension
Tokenizer PHP Extension
For more information refer this document.
有关更多信息,请参阅此文档。
回答by Sahan Pasindu Nirmal
Change artisan serve port using this command
使用此命令更改工匠服务端口
php artisan serve --port=####
instead #### you can enter your own port number.
相反,#### 您可以输入自己的端口号。
This will work sure.!
这肯定会奏效。!