简体   繁体   English

Laravel 服务器不断启动和关闭

[英]Laravel Server keep starting and closing

I am new to Laravel. After installing the composer this problem occurs.我是 Laravel 的新手。安装作曲家后出现此问题。 I change the port number to 1000 but nothing changed.我将端口号更改为 1000,但没有任何变化。 So don't know what to do.所以不知道该怎么办。

PS C:\xampp\htdocs\WebDev>php artisan view: clear //view clear                                                                       Compiled views cleared!
PS C:\xampp\htdocs\WebDev>php artisan serve                                                                           
Starting Laravel development server: http://127.0.0.1:8000
[Mon Oct 12 22:21:43 2020] PHP 7.4.10 Development Server (http://127.0.0.1:8000) started
[Mon Oct 12 22:22:05 2020] 127.0.0.1:50516 Accepted
[Mon Oct 12 22:22:05 2020] 127.0.0.1:50517 Accepted
[Mon Oct 12 22:22:05 2020] 127.0.0.1:50516 Closing
[Mon Oct 12 22:22:05 2020] 127.0.0.1:50517 [200]: GET /favicon.ico
[Mon Oct 12 22:22:05 2020] 127.0.0.1:50517 Closing
                                                                                                                                                                      

laravel custom port serve, for example, you want on the localhost:1000 laravel 自定义端口服务,例如你想在localhost:1000

php artisan serve --host=localhost --port=1000

sometimes you got an error, already port uses, for that you should kill process有时你会得到一个错误,已经端口使用,为此你应该杀死进程

you can kill php artisan of process你可以杀死进程的php artisan

kilall php

that command make kill all PHP process also, you have other preference find a process which uses the port, and kill it for find process for which one port uses该命令也可以杀死所有 PHP 进程,您还有其他偏好查找使用该端口的进程,并杀死它以查找一个端口使用的进程

sudo fuser -v -n tcp 8000

you can kill process as such你可以杀死进程

kill -9 <process-id>

and again call command php artisan serve --port=1000 shortly然后再次调用命令php artisan serve --port=1000


php artisan serve --host=localhost --port=1000

我有同样的问题,我认为它与端口 8000 相关。也许它已经在使用中或类似的东西,因为当我将端口更改为 9000 时(即: php artisan server --port=9000 )它解决了这个问题并且有效现在就好了。

Disable smadav auto block, you can find it on the smadav icon, bottom right conner of your screen禁用 smadav 自动阻止,您可以在屏幕右下角的 smadav 图标上找到它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM