简体   繁体   中英

Xampp gives error while starting Apache HTTPd

Apache shutdown unexpectedly. This may be due to a blocked port, missing dependencies, improper privileges, a crash, or a shutdown by another method. Press the Logs button to view error logs and check the Windows Event Viewer for more clues If you need more help, copy and post this entire log window on the forums

I found that there was nothing in the logs, and the advice to go to the xampp root with a cmd and run apache_start.bat actually got the error (a missing path in the .conf file) which didn't show up any other way.

All working now.

If this is a fresh install, rather than using the control panel to start Apache, you may want to go to XAMPP's root directory and call apache-start .

In my case, apache was failing to start due to a configuration error

httpd.exe: Syntax error on line 37 of C:/..../xampp/apache/conf/httpd.conf: 
  ServerRoot must be a valid directory

If that's the case, make sure that you run setup_xampp (Thanks to https://stackoverflow.com/a/17978400/239408 !)

Most likely you have blocked port 80. The most common problem is skype, change skype settings to use a different port, and restart. Then run apache.

IF you encounter this kind of error in XAMPP


" This may be due to a blocked port, missing dependencies, improper privileges, a crash, or a shutdown by another method. Press the Logs button to view error logs and check the Windows Event Viewer for more clues If you need more help, copy and post this entire log window on the forums "


1) First thing you do is click the Netstat on the Xampp (it will give you the list of names, ports, address and PID)

2) Find the Port 80 and Check the Name who uses the port. for Example [ httpd.exe ]

3) Then go to the window task manager and click the processes

4) Find the Name of the application who uses the port. click the name and click end process

5) then back to the Xampp and click Start

Right click on Xampp Control Panel, and click on ' Run as Administrator '

That solved my problem.

I previously installed my XAMMP on one of my usb keys. Windows exchanged inadvertently their drive letters, making all my paths wrong in my XAMMP setup files. I changed back manually the drive letter of one key (before replugging the other one into my pc) so everything is ok again. Hope this was helpfull. JoVD.

As I am working in a corporate environment where developers faces firewall issues, none of the other answers resolved my issue.

As the port is not used by Skype, but by some other internal applications, I followed the below steps to resolve the issue:

Step 1 - From the XAMPP Control Panel, under Apache, click the Config button, and select the Apache (httpd.conf).

Inside the httpd.conf file, somehow I found a line that says:

Listen 80 And change the 80 into any number / port you want. In my scenario I'm using port 8080.

Listen 8080/1 Still from the httpd.conf file, I found another line that says:

ServerName localhost:80

And change 80 to 8080/1.

ServerName localhost:8080 Step 2 - From the XAMPP Control Panel, under Apache, click the Config button again, but this time select the Apache (httpd-ssl.conf). Inside the httpd-ssl.conf file, find line that says

Listen 443 And change the 443 into any number / port you want. I'll using 4433 as the new port number.

Listen 4433 Still from the httpd-ssl.conf file, find another line that says

ServerName localhost:443 And change 443 to 4433.

ServerName localhost:4433 Remember to save the httpd.conf and httpd-ssl.conf files after performing some changes. Then restart the Apache service.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM