Laravel is the most popular and open-source MVC type PHP framework to create web application. In a recent time, Laravel even crossed Wordpress in creating new websites.
Laravel application server runs on 8000 port when run php artisan serve command in Terminal in localhost. But sometimes when run this command, if port 8000 is already runs by other service, then it failed to run Laravel application with the error
"Failed to listen on 127.0.0.1:8000 (reason: Address already in use)" or Laravel application starts on the port 8001.
There are some ways you can solve this issue. First one is run your Laravel server on other port with the bellow command.
php artisan serve --port 9000
Second way is to kill service which runs on the port 8000 and then run your Laravel application on port 8000. For that first run bellow command, it will display servies which runs on the port.
sudo netstat -plnt
And then find which service runs on the port 8000 and kill that Program name with command. For example, in this here,
23769/php7.2 service is running on the port.
killall -9 php7.2
Or kill service by its PID with command:
sudo kill 23769
Now you can serve your localhost using
php artisan serve command again. Thank you reading this article. Please feel free to give your feedback in the bellow comment section.
What is new in Laravel 8?Hello artisan, I have some good news...
Laravel 8 Eloquent whereNotBetween query exampleLaravel eloquent method whereNotBetween...
How to Run Angular project on different port other than 4200Sometimes you need to run two different...
How to Create a Custom Artisan Command in Laravel 8As we know, Laravel provides artisan com...