View port occupation in Windows and solve port occupation

Source: Internet
Author: User

This article will introduce you to the Windows system to check port occupation and solve port occupation. If you have any need to know about it, please do not go to the reference page.


I believe that PHP developers often get angry that port 80 is occupied by some other services. In the absence of an effective method, you can only restart apache or nginx, or delete software that may occupy port 80.

In fact, we don't have to be so nervous.

The solution is as follows:

1. Check the program that occupies port 80:
Open the command prompt, Enter cmd in the run, and then execute the following command:

Netstat-ano | findstr 80: Search for processes using port 80.

Anyone who has some common knowledge knows that a program corresponds to a process. After finding the process, you will know what the corresponding program is. Then, we can directly end the process.

The command execution line outputs a list. 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: the last line is displayed. A program with process ID 5632 occupies port 80.

2. Find the program by using PID:
@ Open the task manager and click the "process" tab. If the PID Column cannot be found, open it as follows:
Task Manager-View-Select column-select PID.

Find the PID 5632 and end the process.

In this way, the port occupation problem is solved. Of course, we need to restart apache or nginx again.

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.