Search code examples
xampp

XAMPP - Apache could not start - Attempting to start Apache service


While trying to start Apache using XAMPP, I was receiving - "Attempting to start Apache service..." message in XAMPP UI. No further details were available.

Where can I see the logs (I was running XAMPP as Admin) ?

Apache - Fails to start


Solution

  • I realized it was a port issue since I was running IIS and other web servers in my machine. But I was more interested to see a detailed error message with the port number in the UI.

    Seems like it was not logged in the UI or log file (at least in my case), but in the Event viewer (Control panel -> View Event Logs). Under the Even viewer -> Windows Logs -> Application

    I could see a permission error something like the below one:

    An attempt was made to access a socket in a way forbidden by its access permissions. : AH00072: make_sock: could not bind to address 0.0.0.0:443

    To fix this permission issue for SSL port, Please change the below line in httpd-ssl.conf (C:\xampp\apache\conf\extra)

     # When we also provide SSL we have to listen to the 
     standard HTTP port (see above) and to the HTTPS port
    
         Listen xxx
    

    Replace XXX with any valid port number that is open in your machine

    If you are having issues with Port 80, then change the httpd.conf file (C:\xampp\apache\conf)

    # Change this to Listen on specific IP addresses as shown below to 
    # prevent Apache from glomming onto all bound IP addresses.
    #
    #Listen 12.34.56.78:80
     Listen 127.0.0.1:8000
    

    I have also summarized other solutions that I came across:

    1. Most often Skype blocks the Apache port. So terminate it and try again.
    2. Find the process id (PID) that is using the Blocked port ( netstat -ano) and kill the corresponding process in Windows Task Manager.