after making changes to httpd.conf I want to restart Apache as service in Xampp. I removed it first as per Nelson's advice:

sc delete apache2.2

When I check svc on the xampp control panel the service apparently restarts, i.e. I can successfully delete it again with the forementioned command, but on the Xampp control panel it says "stopped" (gray on a gray background). Clicking "start" doesn't change things, though I get a message "Apache service started".
In httpd.conf I changed DocumentRoot, but Apache doesn't seem to see the changes, though it seems to be running. At least I get a page for http://localhost, but not the page the new DocumentRoot refers to.
Any idea of what's wrong here?

When I try to start Apache using the Services Console I get an error "Windows could not start the Apache2.2 on Local Computer, patatee, patata...". The error log mentions event 3299.


"sc delete" deletes a Windows service, that is the service no longer exists and can't be started, stopped or whatever. The service wouldn't be recreated until you reinstall Apache or use the sc command to recreate the service. The corretc way to restart the service from the command line would have been:

net stop apache2.2
net start apache2.2

(annoyingly there is not a "net restart" option).

If you use "net start apache2.2" does it return an error? If you get an error "The service name is invalid." then you need to recreate the service. I don't know how to do this offhand but it should be straightforward.


A service specific error occurred: 1

This indicates the Apache service is installed, but Apache itself is reporting an error when it starts. Possibly something wrong with it's config files. The usual tactic is to try running Apache as an application so you can see any error messages it produces. See http://httpd.apache.org/docs/2.2/platform/windows.html#wincons for stuff on running Apache as an application.


I've never used XAMPP's Control Panel. But when I last used XAMPP, I eventually found the easiest way to restart Apache was through Window's regular Services console.

| improve this answer | |

I know this doesn't directly answer your question, but I recommend installing apache/php/perl/mysql by hand. This will enable you to:

  • understand how these components are linked
  • change component version as needed (some projects may require different versions)
  • start these components in console - this will help you debug and controll better
  • you can have several installations for different projects - this way it's easy to throw away an installation, and rebuilt it, without affecting the other projects

Tools like XAMPP are great to quickly have an installation at hand; but they are not without faults. While the promise of integration is appealing, most of the time you will have to do it by hand - and it's a more powerfull aproach.

If you need to mess with windows services, I recommend this great free tool: Windows Service Commander.

| improve this answer | |

[Oh, great! Since it was moved here from stackoverflow, I can't edit my own message!]

I tried "net start apache2.2", but it says

The Apache2.2 service could not be started

A service specific error occurred: 1.

More help is available by typing NET HELPMSG 3547.

The command in the last line didn't give any more information.

I realize I can't start a service which isn't running, but I thought that was what the svc-checkbox on the xampp control panel was for. When checking it a dialog "Click OK to install the Apache Service" is shown, and when I do it says "Apache service started".

| improve this answer | |
  • See my edit above – John Rennie Jul 11 '09 at 16:20

You can also restart the apache service directly through the apache executable, and you have a -k reload/restart option.

apache2.exe -k restart -n "apacheservicename"


| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.