15

Hej, I have problem with:

Apache Service detected with wrong path

4:31:33 PM [Apache] Change XAMPP Apache and Control Panel settings or
4:31:33 PM [Apache] Uninstall/disable the other service manually first
4:31:33 PM [Apache] Found Path: "C:\Apache\bin\httpd.exe" -k runservice
4:31:33 PM [Apache] Expected Path: "c:\xampp\apache\bin\httpd.exe" -k runservice

How to fix it? In advance, thank you.

SLobodan
  • 151
  • 1
  • 1
  • 4

9 Answers9

44

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:

  1. Win + R and type regedit then enter
  2. Open this directory HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Apache2.4
  3. Right-click on the "ImagePath" and choose "Modify"
  4. Change the Value Data field with your current installed path of apache in XAMPP
  5. In my case, the value is "D:\apps\xampp\apache\bin\httpd.exe" -k runservice
  6. 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

Rio Hilmy
  • 600
  • 4
  • 10
21

I experienced the same problem. The solution that worked for me is :

  1. Run the XAMPP in the administrator mode. Go to the XAMPP control panel.

  2. In the modules section, in the 'Service' column, we are provided with checkboxes.'

  3. For the services that you are facing problems with, click on the corresponding checkbox to uninstall the service.

  4. Also, click on the same checkbox again to re-install the service.

I hope it works! Xampp control panel screenshot

Siong Thye Goh
  • 3,518
  • 10
  • 23
  • 31
Parul Sinha
  • 211
  • 2
  • 2
  • If everything is normal, this should work. But if this control panel can't access the service, there is no way you can uninstall here. But if you can see the ticks, that should work. – AkiEru Jul 03 '20 at 02:40
  • This right here worked for me!!! Thanks – jovialcore Oct 11 '21 at 15:44
  • In some cases we have to restart the PC even after reinstalling the services (for new devs). – ARHAM RUMI Sep 15 '22 at 05:28
13

Try

Control panel > Administrative Tools > Services, after get de services name, in my case:

Apache2.4
mysql

Run "CMD" as administrator and put this command:

C:/windows/system32> sc delete Apache2.4
C:/windows/system32> sc delete mysql

Close Xampp Panel and try again.

Greetings from Mexico.

Ransomware0
  • 427
  • 3
  • 10
7

I was also experiencing the same problem for some days. Finally, I got the solution. Follow the given steps, that worked perfectly for me:

  1. RUN the XAMPP Control Panel As Administrator
  2. Below the Service column, you will see checkboxes, click on the checkbox to install it (if not already installed marked as RED CROSS) and if it is already installed, then uninstall it first by clicking on the GREEN TICK. Make sure the service is STOPPED
  3. Then START the service again. That's all. Enjoy
  4. Still not working, close the XAMPP, RUN it again as Administrator
  5. Still not working, restart the PC (I have just experienced it)
ARHAM RUMI
  • 441
  • 5
  • 11
3

Although Old Question but common problem for the new developers. Solution for my case:

Run "CMD" as administrator and put this command:

C:/windows/system32> sc delete Apache2.4

restart the Xampp

Dip Hasan
  • 225
  • 3
  • 9
1

It means you have Apache installed and running service from the location C:\Apache\bin\httpd.exe

You need to stop the service and start xampp

B L Praveen
  • 1,812
  • 4
  • 35
  • 60
  • How to stop the service? – SLobodan May 31 '15 at 14:57
  • You can got to service management console http://www.windows-commandline.com/run-command-for-services-management/ and search Apache Service running and stop. – B L Praveen Jun 01 '15 at 02:45
  • Ok I found Run command , but i couldn't find the path, i think it is cause i deleted all apache files before you answered me before. Simply Apache not found. There is no other explanation about it. So it is still running, is there other way to stop it. – SLobodan Jun 02 '15 at 18:33
  • Did you execute the setup_xampp.bat script? or even removing C:\Apache\bin\httpd.exe from the ENV Path – B L Praveen Jun 03 '15 at 03:04
  • First I tried to install it one by one, (apache, Php, MySql), Apache worked, but Php didn't so i removed all, and then i installed xampp. I removed C:\Apache\bin\httpd.exe before the Installation of xampp.bat. – SLobodan Jun 03 '15 at 15:39
0

If you planing to work with XAMPP environment more comfortable way is:

  • Uninstall Apache (at C:\Apache\bin\httpd.exe)
  • Check Apache process at C:\Apache\bin\httpd.exe if it in memory - kill it.
mrLSD
  • 688
  • 1
  • 5
  • 14
  • Further note: to uninstall Apache, once in the directory (C:\Apache\bin), open a cmd prompt (with admin privilege) and execute "httpd -k uninstall". – Halogen Oct 07 '16 at 21:43
0

Change your port in the httpd.conf file, this might solve the problem because you might have a Node.JS server or Skype or another application running at port 80.

Kos
  • 4,890
  • 9
  • 38
  • 42
0

I will assume that you have uninstalled and reinstalled XAMMP multiple times, due to the fact that Apache has started the service with the wrong path. The key is to delete the service and restart XAMMP control panel