I’ve searched far and wide on the internet for answers but with no success. I downloaded xampp a couple of months ago and everything has worked fine until recently. I noticed the problem when I was unable to access localhost so I went onto the xammp control panel and saw that apache was turned off. When I click start now every time I get this message –
13:41:55 [Apache] Error: Apache shutdown unexpectedly.
13:41:55 [Apache] This may be due to a blocked port, missing dependencies,
13:41:55 [Apache] improper privileges, a crash, or a shutdown by another method.
13:41:55 [Apache] Press the Logs button to view error logs and check
13:41:55 [Apache] the Windows Event Viewer for more clues
13:41:55 [Apache] If you need more help, copy and post this
13:41:55 [Apache] entire log window on the forums
A common answer to this seems to be to change the port from 80 to 8080 in the httpd.conf file and then changing it from 443 to 4433 in the httpd-ssl.conf file. I have already done this and still not working. When I check the apache error logs it says –
AH00020: Configuration Failed, exiting
It might be worth mentioning that I installed WordPress on my local server a few days ago and maybe that might have something to do with it? I have tried everything from re-starting my computer to running a full virus scan and nothing seems to work.
I am using Windows 10, Apache version 2.4 and PHP 7.
I’ve now also tried typing in the command “httpd -t” in Shell and it returns “syntax OK”. Also here is a sample from the apache error log –
PHP Warning: 'vcruntime140.dll' 14.0 is not compatible with this PHP build linked with 14.16 in Unknown on line 0
[Tue Jun 09 04:15:03.462661 2020] [:emerg] [pid 4160:tid 548] AH00020: Configuration Failed, exiting
[Tue Jun 09 12:54:30.209908 2020] [core:warn] [pid 4000:tid 684] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
PHP Warning: 'vcruntime140.dll' 14.0 is not compatible with this PHP build linked with 14.16 in Unknown on line 0
[Tue Jun 09 12:54:30.239019 2020] [:emerg] [pid 4000:tid 684] AH00020: Configuration Failed, exiting
Thanks for taking the time to read this and if anyone has any ideas it would be much appreciated.
2
Answers
Ok I've managed to solve the proplem.
For anyone who is having the same problem (apache won't start even if port 80 is available) this info could be useful.
When I looked through the apache error logs there were a number of errors but the particular error causing the problem was -
If anyone else gets this error it can be solved by installing the "Visual Studio 2015, 2017 and 2019" runtime (x64: vc_redist.x64.exe). Here's the link to where you can download it.
https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads
After the download is finished, go into xampp folder and right click on xampp-control.exe, click "run as administrator" then you should be able to start apache with no problems.
Hope this will help anyone who winds up in the same situation as I did.