John Davidson

linux - kill PHP server with port

0 comments
Message:


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



My Answer:
You can use the following command to kill a PHP server running on a specific port in Kali Linux:

bash
sudo lsof -t -i:8080 | xargs kill


This command uses `lsof` to list all processes listening on port 8080 and then pipes the output to `kill` to terminate those processes. Make sure to replace `8080` with the actual port number of your PHP server.

Rate this post

4 of 5 based on 1397 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us