21

I have installed XAMPP on my windows 7 machine but can't get Apache to work.

On start I get the following errors:

13:09:21  [apache]  Apache Service Detected With Wrong Path
13:09:21  [apache]  Uninstall the service manually first
13:09:21  [apache]  Possible problem detected! 
13:09:21  [apache]  Port 80 in use by "system"!
13:09:21  [tomcat]  Tomcat Service Detected With Wrong Path
13:09:21  [tomcat]  Uninstall the service manually first

After opening the XAMPP panel and installing Apache service: I have tried start it, it always get stuck "Starting apache service..."

Any advice on how I could resolve this ?

Thanks Jamil

Jamil
  • 591
  • 1
  • 5
  • 16
  • 3
    Have you made sure nothing else is running on port 80? – smilly92 Aug 03 '12 at 11:29
  • go start>cmd , then write "netstat -o" and see if port 80 is busy . – URL87 Aug 03 '12 at 11:33
  • Also is there any case that you may have had installed Apache on your windows before xampp? – Panos Aug 03 '12 at 11:33
  • Sorry there were some useful info that I have not noticed initially , I have modified my post. Weirdly enough, port 80 doesn't appear to be used via Netstat despite the error shown in my post – Jamil Aug 03 '12 at 12:14
  • @Jamil ; check if it conflict with IIS or SQL Server (if you had before) – URL87 Aug 03 '12 at 13:15
  • Possible duplicate of [Trouble with Apache in Xampp after multiple Apache installs](http://stackoverflow.com/questions/19124599/trouble-with-apache-in-xampp-after-multiple-apache-installs) – izk May 12 '16 at 11:07

9 Answers9

63

I was able to fix this!

Had the same problems as stated above, made sure nothing was using port 80 and still not working and getting the message that Apache and Mysql were detected with the wrong path.

I did install XAMPP once before, uninstalled and reinstalled. I even manually uninstalled but still had issues.

The fix. Make sure you backup your system first!

  1. Start Services via Control Panel>Admin Tools (also with Ctrl+R and services.msc)

  2. Look for Apache and MySQL services. Look at the patch indicated in the description (right click on service then click on properties). Chances are that you have Apache listed twice, one from your correct install and one from a previous install. Even if you only see one, look at the path, chances are it's from a previous install and causing your install not to work. In either case, you need to delete those incorrect services.

    a. Got to command prompt (run as administrator): Start > all programs > Accessories > right click on Command Prompt > Select 'run as administrator'

    b. on command prompt type sc delete service, where service is the service you're wanting to delete, such as apache2.1 (or sc delete Apache2.4). It should be exactly as it appears in your services. If the service has spaces such as Apache 2.1 then enter it in quotes, i.e. sc delete "Apache 2.1"

    c. press enter. Now refresh or close/open your services window and you'll see it`s gone.

DO THIS for all services that XAMPP finds as running with an incorrect path.

Once you do this, go ahead and restart the XAMPP control panel (as administrator) and voila! all works. No conflicts

Ram Ghadiyaram
  • 30,194
  • 13
  • 83
  • 107
Fernando Pineda
  • 646
  • 5
  • 2
  • That's really cool. Thank you. To summarize, all we need is to delete previous apache service from services using sc command: `sc delete Apache2.4` – ivkremer Feb 13 '13 at 09:16
  • In my case the `Apache` Service was disabled. Thank you. – Sumit Gera Feb 24 '13 at 12:33
  • Thank you so much! I tried it several times but all it needed was to initiate XAMPP and CMD as Admin, I wager this issue would never have happened if from the very beginning I would have run XAMPP as Admin. – Norwin Apr 09 '13 at 04:31
  • I have installed and reinstalled as well, but unfortunately there was no Apache service listed ... does anybody know why? – Zyoo Jul 24 '13 at 10:39
  • Thank you. It solved the issue. Any idea why we get "Connection refused" error while we enter http://localhost on the browser? – FlashyFuddyFuddy Sep 29 '15 at 06:10
  • You rock, I have been having an issue with this for a while now and this fixed it! – Alex Jun 15 '16 at 14:07
  • Worked as a charm. I believe xampp should add this possible issue somewhere in their official docs (if they have not done so yet) – Olga Gnatenko Aug 31 '16 at 00:41
12

my friend this the will fix ur problem ;)

in root of folder ( xampp ) just run this file ( setup_xampp.bat ) then press enter

and try to start the apache server

every things will work like charm ;)

Tarek Sibay
  • 137
  • 1
  • 2
3

The most likely reason would be that something else is using port 80. (Often this can be Skype, IIS, etc.)

This tutorials shows How to Change the Apache Port in XAMPP

smilly92
  • 2,255
  • 1
  • 22
  • 42
3

I spent over 3 hours to find out solution. Actually port 80 was being used by "system" service so I tried to change port from 80 to 8080 in "httpd" file but same problem raised "port 80 is used by system". It had driven me mad for 3 hours as every thing was changed like port , localhost server etc pointing to 8080.

At last I found mistake that was server root. Basically "Server Root" in "httpd" should be pointing to apache foler of xampp. In my case that's was

ServerRoot "xampp/apache"

I just changed it as follows:

ServerRoot "C:/xampp/apache" 

It has worked successfully and now everything is running with OK status.

codemania
  • 1,102
  • 1
  • 9
  • 24
2

refer this:- http://www.sitepoint.com/unblock-port-80-on-windows-run-apache/

and to enable telnet http://social.technet.microsoft.com/wiki/contents/articles/910.windows-7-enabling-telnet-client.aspx

Don
  • 21
  • 1
1

I encountered the same issue after XAMPP v3.2.1 installation. I do not have Skype as most people would believe, however as a Software Developer I assumed port 80 is already in use by my other apps. So I changed it by simply using the XAMPP Control Panel: enter image description here

Click on the 'Config' button corresponding to the APACHE service and choose the first option 'Apache (httpd.conf)'. In the document that opens (using any text editor - except MS Word!), locate the text:

Listen 12.34.56.78:80

Listen 80

And change this to:

Listen 12.34.56.78:83

Listen 83

This can be any non-used port number. Thanks.

Community
  • 1
  • 1
Chagbert
  • 646
  • 6
  • 14
0

I know this is somewhat of an old topic, but in case anyone reads this in the future...

I uninstalled xampp, deleted everything under the c:\xampp folder, then reinstalled xampp as administrator and it worked like a charm.

anon
  • 1
0

For me, the problem was I had two installations of Apache Tomcat

The following steps solved my problem:

  1. Open up services.msc in command prompt
  2. Select the Apache Tomcat service, right click and select properties
  3. Check the path to the executable of the service
  4. Follow the instructions in https://stackoverflow.com/questions/7190480/modifying-the-path-to-executable-of-a-windows-service to change the path to "\tomcat\bin\tomcat7.exe" //RS//Tomcat7
  5. Restart XAMPP Control Panel
Community
  • 1
  • 1
chaitanya
  • 1,531
  • 1
  • 24
  • 36
0

I had my Apache service not start same as MySQL one. Please follow these steps if none of above tips works :

  1. Open regedit.exe on any windows this available . Run as administrator. (Only on windows 7 and later editions )
    1. Go to local machine/system/controlset001/services
    2. Find and delete folders of services apache and mysql .
    3. Uninstall xampp . Delete folder of xampp.
    4. Restart computer and reinstall Xampp . After that your Xampp apache and Mysql should work.

Note: Ports 80 and 443 must be unused by any program. 
      If it is in use . Just edit ports. There is a lot of tutorials about that .
Powiux
  • 1
  • 4