I just encountered the exact same problem a few days ago and was having a hard time finding the fix, but I finally able to fix it.
Here's my fix:
- Win + R and type regedit then enter
- Open this directory HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Apache2.4
- Right-click on the "ImagePath" and choose "Modify"
- Change the Value Data field with your current installed path of apache in XAMPP
- In my case, the value is "D:\apps\xampp\apache\bin\httpd.exe" -k runservice
- For the question poster case, change the value to "C:\xampp\apache\bin\httpd.exe" -k runservice
I know it's an old post, but some people might still need this in the future. I hope it can help :)
UPDATE 12/7/2022:
This is due to our local machine already has Apache installed aside from XAMPP's Apache OR previously has installed XAMPP but in different folder directory. So my fix above is to change the Apache's target path to XAMPP's Apache path (In the folder where you installed xampp).
Another way to fix is to uninstall your existing Apache. You can find the folder directory from the error message that you got. the Found Path: C:\Apache\blablabla
which could vary in every machine