I just tried to automate the laravel process like(Start, Stop) in shell scripts. To start the laravel server, I use php artisan serve in the shell file.
I tried to stop the laravel server using command. But I was wonder, I didnt see any commands to stop the server. I used to Ctl+C to stop the server or to close the command prompt.
1.Any laravel commands to stop the server ?
How can I stop them now ? I dont have any command prompts running this process to exit the server.
“stop laravel server” Code Answer's and press ctrl+c. It will stop your server.
Press Ctrl + Shift + ESC. Locate the php process running artisan and kill it with right click -> kill process. Reopen the command-line and start back the server. Note that you should be able to kill the process just by sending it a kill signal with Ctrl + C.
How to stop laravel server? Well you have started your laravel server successfully now you want to stop server. To execute php artisan serve stop simply goto your commnad line where your server is running and press ctrl+c. It will stop your server.
Press the (X) button on the top right(on Windows/Linux)/Press the red color circle on the top left(on Mac OS) of the terminal window to stop the PHP server from running.
You can kill the port
sudo kill $(sudo lsof -t -i:port_number)
Like if it is running on 8000, you can do below
sudo kill $(sudo lsof -t -i:8000)
If above not worked (because frozen or unresponsive process may not respond), add parameter -9
to kill command like this:
sudo kill -9 $(sudo lsof -t -i:8000)
Easier and you can view all processes about artisan :)
ps aux | grep artisan
# get the PID from the list
kill <PID NUMBER>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With