halkujabra
halkujabra

Reputation: 2942

revert 'php artisan serve' command in laravel

I have a laravel app. I ran 'php artisan serve' command for local testing and my app was served at localhost:8000. But now I want to stop serving it at localhost:8000 ie., I want it not to serve now.

I closed the command line, restarted the server but it is still serving. How can it be done?

Note: I am using windows for testing purposes.

Upvotes: 30

Views: 115432

Answers (10)

Albert Ndizeye
Albert Ndizeye

Reputation: 151

This work for me.

sudo kill $(sudo lsof -t -i:port_number)

Upvotes: 6

Aissam EL HOUREF
Aissam EL HOUREF

Reputation: 21

In Windows CMD or smder: CTRL + C

Upvotes: 1

Jay
Jay

Reputation: 239

If your using VS Code, simply do the following:

  1. Open VS Code terminal
  2. Find the drop down box that displays a list of all the running shells
  3. Select "php" from the list and click the garbage bin icon

This deletes the shell and kills the server.

Upvotes: 1

user1506104
user1506104

Reputation: 7106

When I use cygwin to run my php artisan serve on Windows machine, pressing ctrl + c does not kill the process. To stop it, use @jsalonen's solution. Basically you are looking for this then kill it:

enter image description here

Upvotes: 6

Mohammed Omer
Mohammed Omer

Reputation: 1236

here is what i do press ctrl+ c

> lsof -i :8000

to check if the port is busy or not if any process is listening to the port 8000 it will be displayed with port id

> sudo  kill -9 [PID]

kill the process that listen to that port id

run lsof agin

> sudo lsof -i 8000

vola

Upvotes: 53

mareq133
mareq133

Reputation: 53

Windows 10 with XAMPP server depending on what shell you use to run:

php artisan serve

In Windows CMD: CTRL + C
In XAMPP Shell: CTRL + Pause/Break

In Ubuntu and RedHat/CentOS terminal it's: CTRL + C

Upvotes: 5

Ctrl + Pause|Break should do it for Windows.

Upvotes: 3

T-Bee
T-Bee

Reputation: 131

For windows user, type this command for showing the list of current running php artisan process:

tasklist /FI "IMAGENAME eq php.exe"

Will show:

Image Name ---- PID ---- Session Name ---- Session ---- Mem Usage

php.exe --------- XXXX ---- Console ----------  4 ------- 19.852 K

Look up PID number (XXXX), and type this to kill the process:

taskkill /F /PID XXXX

Upvotes: 8

David Noleto
David Noleto

Reputation: 163

I used Ctrl + C in my mac for stop the command php artisan laravel serve

Upvotes: 12

jsalonen
jsalonen

Reputation: 30501

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.

Upvotes: 23

Related Questions