Windows system View port occupancy and resolve port occupancy

Source: Internet
Author: User


People who believe in PHP development often get annoyed that 80 ports are occupied by some other service. In the absence of an effective method, you can only continually restart Apache or nginx, or remove software that believes it may be consuming 80 of ports.

Actually, we don't have to be so nervous.

The workaround is as follows:

1. View the program that occupies 80 ports:
Open a command prompt, in which you enter: CMD, and then execute the following command:

Netstat-ano | FINDSTR 80 This command means to find a process that uses port 80.

There must be some system common sense people know that generally a program corresponds to a process. Find the process, then you know what the corresponding program is. Then, we can simply end the process.

The command executes the row, outputting a list, and the last column of the list is PID.

TCP 0.0.0.0:80 0.0.0.0:0 Listening 2060
TCP 0.0.0.0:8800 0.0.0.0:0 Listening 924
TCP 0.0.0.0:49153 0.0.0.0:0 Listening 1080
TCP 0.0.0.0:49162 0.0.0.0:0 Listening 680
TCP 192.168.100.111:80 192.168.100.111:54888 time_wait 0
TCP 192.168.100.111:49422 123.58.182.253:80 established 5632 can see the last line, and a program with a process ID of 5632 occupies our 80 port.

2, through the PID to find the program:
@ Open Task Manager, click on the "Processes" tab, if the inside can not find the PID column, the following way to open:
Task Manager-View-Select column-Tick PID.

Then, find the 5632 PID and end the process.

This solves the problem of port occupancy. Of course, we have to restart Apache or Nginx.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.