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

后端 未结 20 1753
悲哀的现实
悲哀的现实 2020-12-31 09:27

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

相关标签:
20条回答
  • 2020-12-31 09:42

    Starting Xampp as a console application (simply by doubleclicking xampp_start.exe in the Xampp root folder) was the only thing that worked for me on Windows 10 (no Skype, no Word Wide Web Publishing Service). WampServer and UwAmp also didn't work.

    0 讨论(0)
  • 2020-12-31 09:47

    Had the same issue while updating to PHP7.2

    Problem: First I closed skype and then checked whether port 80 is not an issue. How you can check that? See @AlexT comment above.

    In my case, port 80 wasn't an issue. So now I had to figure out what was wrong. So I checked Error Logs Control Panel > Even viewer > Windows Logs > Application and found following error against Apache2.4

    httpd.exe: Syntax error on line 520 of C:/xampp/apache/conf/httpd.conf: Syntax error on line 18 of C:/xampp/apache/conf/extra/httpd-xampp.conf: Cannot load C:/xampp/php/php7ts.dll into server: The Apache service named is not a valid Win32 application.

    Which means I had installed wrong PHP version. Actually I downloaded win64 version while the required version was Win32 for me.

    So I downloaded correct version from: Download PHP 7.2.0 extracted it in C:/xampp/php folder, restarted the apache and it worked :)

    0 讨论(0)
  • 2020-12-31 09:49

    IF PORT 80 IS NOT THE ISSUE!

    Check to see if the port 80 is in use first as this can be an issue. You can do this by typing "netstat -an" into cmd. The look for 0.0.0.0:80 under Local Address, if you find this is in use then follow the solution from @Karthik. However, I had a similar issue but my port 80 was not in use. My XAMPP had wrong paths locations, steps to fix this:

    1.Find out the Apache version you are using, you can find this by looking in Services (Control panel, Admin Tools, Services) and finding Apache in my case it was listed as Apache2.4

    2.Close XAMPP.

    3.Run cmd as admin.

    4.execute 'sc delete "Apache2.4"' (put your version in place of mine and without the surrounding ' ', but with the " " around Apache).

    5.execute 'sc delete "mySQL"', again remove the '' when you type it.

    6.reopen XAMPP and try starting Apache

    If you are having trouble with FileZill, Mercury, or Tomcat you could try it here too, but I have not tested that myself.

    Hope this helps!

    0 讨论(0)
  • 2020-12-31 09:50

    I had this issue when I installed under Program Files, which they do not recommend due to write issues. This might only be a problem if you are not logged in as an admin and use a password to install. I just uninstalled and installed in a directory that did not need admin privileges.

    0 讨论(0)
  • I had the same issue.Just click on services button.Then find apache and right cick > properties > set startup type as Automatic/ Manual. Now close apache and try again.It will work!

    0 讨论(0)
  • 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.
    0 讨论(0)
提交回复
热议问题