Windows – Apache no longer starts at Windows boot up

apache-2.2windows

I have Apache installed as part of XAMPP – local test server. It is configured as a Windows (XP) Service. Startup type is "Automatic". For a long time now it has always started when Windows boots up, but recently this has stopped happening. I now need to start it manually via the XAMPP Control Panel – at which point it appears to start up perfectly OK.

The only recent updates to the machine (that I recall) are Windows Updates – none of which appear to have "known issues" that relate to this. And updates to Google Chrome.

Any ideas what could prevent Apache from starting automatically at Windows (XP) boot up?

EDIT#1

There are 2 related Errors in my system event log regarding the Service Control Manager:

  1. Timeout (30000 milliseconds) waiting for the Apache2.2 service to
    connect.

  2. The Apache2.2 service failed to start due to the following error: The
    service did not respond to the start or control request in a timely
    fashion.

When I manually start the Apache server after boot up there are 2 "information" events stating that it was "sent a start control" and that it "entered the running state". Although I notice it appears to take 19 seconds between the start control being sent and entering a running state – according to the event log.

So, maybe 30 seconds during boot up isn't long enough (anymore) for Apache to start??

Best Answer

If you experience service start up problems at boot for services set to "Automatic", try to delay it by configuring a dependency. E.g. set the apache service to depend on the TCP/IP stack. This way it will start only after the TCP/IP service.

Another way could be to set it to Manual, and have a scheduled task run at startup that invokes a script that waits for 60 seconds and the starts the apache service, like:

WScript.Sleep(60000)

strServiceName = "Apache Server Service"
Set objWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set colServices = objWMI.ExecQuery ("Select * from Win32_Service Where Name ='" & strServiceName & "'")
For Each objService in colServices
    objService.StartService()
Next
Related Topic