When learning PHP, accidentally found that the XAMPP Windows Apache startup error, the following error message appears:
9:52:41 [Apache] attempting to start Apache app ...
9:52:41 [Apache] Status Change detected:running
9:52:42 [Apache] Status Change detected:stopped
9:52:42 [Apache] error:apache shutdown unexpectedly.
9:52:42 [Apache] This is due to a blocked port, missing dependencies,
9:52:42 [Apache] improper privileges, a crash, or a shutdown by another method.
9:52:42 [Apache] Check the "/xampp/apache/logs/error.log" file
9:52:42 [Apache] and the Windows Event Viewer for more clues
This problem is common, usually 80, 443 ports are occupied
CMD prints the following log by running Apache/bin/httpd.exe:
By running CMD, enter the command line netstat-a to see all the ports that are occupied, such as:
It is known that 443 of the port is occupied, causing Apache to not start properly;
The solution is as follows:
(OS 10048) is typically used only once per socket address (Protocol/network address/port). : Make_sock:could not bind to address 0.0.0.0:443
or 80 ports in the back.
(OS 10048) is typically used only once per socket address (Protocol/network address/port). : Make_sock:could not bind to address 0.0.0.0:80 or [::]:80
The quickest way to deal with this is to modify the port number:
1, 443 port is occupied, Apache can not listen to 443 port, how to solve it?
In/xampp/apache/conf/extra/httpd-ssl.conf
Change Listen 443 to 444 (customizable)
2, 80 port is occupied, Apache can not listen to 80 port, how to solve it?
In/xampp/apache/conf/extra/httpd.conf
Change Listen 80 to 88 (customizable)
If vhosts is configured, please change the port in the httpd-vhosts.conf to 88 (same as the upper number)
Two, the most direct method is to close the 80, 443 ports of the process:
1. Through the cmd Netstat-ano look at the machine 80, 443 port is occupied no-------here may be occupied by other programs such as IIS, virtual machine, etc.
2. Find the process name that occupies 80, 443 ports by printing tasklist in CMD.
3.taskkill/pid port number to kill this process name, xampp restart Apache.
In summary, the first method is recommended, and the second one is more or less encountered each time it starts.