Few days ago, I installed the latest XAMPP 7.4.9 on my Windows 10 laptop. It comes with PHP version 7.4.9 and was working correctly. But today, when I tried to start the Apache server then it displays an error message. Something like this:-
9:28:12 PM [Apache] Attempting to start Apache app...
9:28:12 PM [Apache] Status change detected: running
9:28:13 PM [Apache] Status change detected: stopped
9:28:13 PM [Apache] Error: Apache shutdown unexpectedly.
9:28:13 PM [Apache] This may be due to a blocked port, missing dependencies,
9:28:13 PM [Apache] improper privileges, a crash, or a shutdown by another method.
9:28:13 PM [Apache] Press the Logs button to view error logs and check
9:28:13 PM [Apache] the Windows Event Viewer for more clues
9:28:13 PM [Apache] If you need more help, copy and post this
9:28:13 PM [Apache] entire log window on the forums
After trying different solutions from StackOverflow (like changing the port number), the problem still exists.
I would also like to mention that I don't have Skype installed on my laptop. I even tried to change my localhost ports from "80" to "8080" and "443" to "4433". But, nothing seems to work.
Finally, I opened the Apache "error.log" file by clicking the "Logs" button infront of "Apache" in XAMPP Control Panel. This file shows a weird message:-
PHP Warning: 'vcruntime140.dll' 14.0 is not compatible with this PHP build linked with 14.16 in Unknown on line 0
I think if I somehow manage to fix this error then the issue will probably be resolved. But, I'm out of ideas right now. So, do know the reason behind this error message? and how to fix it?
Basically, PHP version 7.4.x requires Microsoft Visual C++ Redistributable for Visual Studio 2019. You can download it from here and then simply install it.
After that, try to start Apache. Hopefully, this time it will work without any issues.