When I started Apache on XAMPP, it will run then stop and displayed an error message i.e. “Apache shutdown unexpectedly”.
PM 04:22:16 [Apache] Attempting to start Apache app…
PM 04:22:18 [Apache] Status change detected: running
PM 04:22:20 [Apache] Status change detected: stopped
PM 04:22:20 [Apache] Error: Apache shutdown unexpectedly.
PM 04:22:20 [Apache] This may be due to a blocked port, missing dependencies,
PM 04:22:20 [Apache] improper privileges, a crash, or a shutdown by another method.
PM 04:22:20 [Apache] Press the Logs button to view error logs and check
PM 04:22:20 [Apache] the Windows Event Viewer for more clues
PM 04:22:20 [Apache] If you need more help, copy and post this
PM 04:22:20 [Apache] entire log window on the forums
Find Listen 80 and convert it to Listen 81.(or some other port number as per you wish)
NOTE:When you try to run xampp you should use “localhost:81/xampp/” instead of “localhost/xampp/”
Find ServerName localhost:80 to ServerName localhost:81
Save the notepad. Be sure that you can save the notepad file only if you open the XAMPP control panel as an Administrator. Now, start the Apache. It will run now.