Reputation: 76
I want to kill PHP server with port
I know I can kill PHP server whit this code:
ps -ef | grep php
kill -9 php
but I want to kill PHP server with it's port:
something like:
kill php port 8080
and my device is KALI-LINUX
Upvotes: 0
Views: 2663
Reputation: 1711
Easiest way to kill php server with port is by using the process manager - for example "activity monitor" in OS X
Upvotes: 0
Reputation: 86
If you want to kill any service or process running on port number 8080 then first you need to find the 8080 port process identification number(PID) and then kill it. Run the following command to find 8080 port number PID:
sudo lsof -t -i:8080 Here,
sudo - command to ask admin privilege(user id and password). lsof - list of files(Also used for to list related processes) -t - show only process ID -i - show only internet connections related process :8080 - show only processes in this port number So you can now easily kill your PID using following command:
sudo kill -9 Here,
kill - command to kill the process -9 - forcefully You can use one command to to kill a process on a specific port using the following command:
sudo kill -9 $(sudo lsof -t -i:8000)
Another way
kill $(lsof -ti:3000)
fuser -k 8080/tcp
Upvotes: 3