'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
                                                                                                                                                                      


Solution 1:[1]

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

Solution 2:[2]

I had the same issue and I think it's related to the port 8000. Maybe it's already in use or something like this because when I changed the port to 9000 (ie: php artisan server --port=9000) it solved the issue and works just fine now.

Solution 3:[3]

Disable smadav auto block, you can find it on the smadav icon, bottom right conner of your screen

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 dılo sürücü
Solution 3 Michael Mhizha