After XAMPP is reinstalled today, Apache cannot be started and the following error is prompted:
22:36:54 [Apache] attempting to start Apache app...
22:36:54 [Apache] status change detected: Running
22:36:55 [Apache] status change detected: stopped
22:36:55 [Apache] error: Apache shutdown unexpectedly.
22:36:55 [Apache] this may be due to a blocked port, missing dependencies,
22:36:55 [Apache] improper privileges, a crash, or a shutdown by another method.
22:36:55 [Apache] Press the logs button to view error logs and check
22:36:55 [Apache] The Windows event viewer for more clues
22:36:55 [Apache] If you need more help, copy and post this
22:36:55 [Apache] entire log window on the forums
The port is occupied. Check the XAMPP/Apache/CONF/httpd. conf file, which uses port 80 and the default port 80 of the browser.
First, run cmd to useNetstat-anoTo view port usage
1. netstat-ano | findstr "80" view the usage of the specified port 80
C: \ Users \ Acer> netstat-ano | findstr "80"
TCP 0.0.0.0: 80 0.0.0.0: 0 listening 4
TCP 0.0.0.0: 1026 0.0.0.0: 0 listening 800
TCP 192.168.0.102: 2113 183.136.138.140: 80 time_wait 0
TCP 192.168.0.102: 2114 183.136.138.140: 80 established 732
TCP [:]: 80 [:]: 0 listening 4
TCP [:]: 1026 [:]: 0 listening 800
UDP [fe80: ce5: bd05: f942: 83da % 18]: 1900 *: * 1744
UDP [fe80: d8c: 1ba: 16b4: 2a29% 17]: 1900 *: * 1744
UDP [fe80: 7469: be65: 7b61: a13b % 14]: 1900 *: * 1744
Indicates the Protocol local address external address status PID in turn
2. UseTasklistCommand to view the PID Process
C: \ Users \ Acer> tasklist | findstr" 732"
Taobaoprotect.exe 732 console 1 7,956 K
Indicates the image name PID session name session # memory usage in turn
3. UseTaskkillCommand to close the process found and remove port occupation
C: \ Users \ Acer> taskkill/F/T/IM taobaoprotect.exe
Successful: The process of PID 732 (which belongs to the PID 1880 sub-process) has been terminated.
However, in some cases, some of our processes cannot be closed, or the corresponding process is too large to close. In the backend, we can choose to modify the port corresponding to Apache. Isn't it the best of both worlds?
We continue to open XAMPP/Apache/CONF/httpd. in the conf file, locate listen80 and change 80 to 81 or 82and so on to ensure that the port is not occupied. You can use the above method for testing.
For the first time, I changed all the 80 s to 81. Later, I found that it is okay to change the value after the listen ~~ For more information, see the detailed explanation of Apache HTTP. conf. I think it should be changed for the moment.
Aha, you can restart Apache. If you are lucky, you can find that the port is occupied.
23:10:29 [Apache] attempting to start Apache app...
23:10:29 [Apache] status change detected: Running
23:10:30 [Apache] status change detected: stopped
23:10:30 [Apache] error: Apache shutdown unexpectedly.
23:10:30 [Apache] this may be due to a blocked port, missing dependencies,
23:10:30 [Apache] improper privileges, a crash, or a shutdown by another method.
23:10:30 [Apache] Press the logs button to view error logs and check
23:10:30 [Apache] The Windows event viewer for more clues
23:10:30 [Apache] If you need more help, copy and post this
23:10:30 [Apache] entire log window on the forums
Google a moment, found that Apache still need port 443, specific can view XAMPP/Apache/CONF/extra/httpd-ssl.conf file, there is a listen443, check the occupation of port 443, again occupied. In the same way, 443 is changed to 444.
You can find the above two files in this way. For example, click config. The first two items are displayed ~
Restart Apache, OK, OK, perfect!
23:20:40 [Apache] attempting to start Apache app...
23:20:41 [Apache] status change detected: Running
Click admin or enter localhost or 127.0.0.1 in the browser,
Not found
HTTP Error 404. The requested resource is not found.
Not found? Because the default port number of the browser is 80, didn't we change the port to 81? In this case, add the port: localhost: 80 to the end of localhost, and press Enter. Then, OK ~