简体   繁体   中英

Laravel Server keep starting and closing

I am new to Laravel. After installing the composer this problem occurs. I change the port number to 1000 but nothing changed. 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

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

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

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 --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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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