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.