可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
I have installed XAMPP (xampp-win32-1.8.2-0-VC9-installer.exe) on Windows 7 successfully. But unfortunately, the following error was found during running Apache from XAMPP Control Panel:
5:38:38 PM [Apache] Error: Apache shutdown unexpectedly. 5:38:38 PM [Apache] This may be due to a blocked port, missing dependencies, 5:38:38 PM [Apache] improper privileges, a crash, or a shutdown by another method. 5:38:38 PM [Apache] Press the Logs button to view error logs and check 5:38:38 PM [Apache] the Windows Event Viewer for more clues 5:38:38 PM [Apache] If you need more help, copy and post this 5:38:38 PM [Apache] entire log window on the forums
回答1:
There are many possible answers for this problem. The most common and most likely is that you're running another program which is blocking port 80 or 443. If you've installed Skype, then you've found your problem! Change apache's port settings to 81 and apache will work. There's a good tutorial on that To check this you can open up your command line by clicking the start menu, and typing 'cmd', and enter the command
netstat -nab
this wil return a list of programs that will vaguely resemble this pattern
[someprogram.exe] UDP [fe80::numbers:numbers:numbers:numbers%numbers]:portnumber
You need to find a line (or lines) ending in :80 and terminate them in order to start apache. If there is no line ending in :80, there are more things you can do.
First, navigate to xampp's directory (default is c:\xampp) and double click apache_start.bat. This will open up a comand line and return more detailed errors about why apache can't run. Mostly, be looking for syntax errors that you could've created by editing your httpd.conf, or httpd-ssl.conf files. This is very easy to do if you've edited it and are a new user.
If still this fails, your last hope is to check the apache error log by clicking on the logs tab in apache's row in the xampp control panel and clicking error log.
If none of this works, don't give up! You got this!
Edit: If you change the port of apache, you will also have to go into httpd.conf (located in xampp/apache/conf) and near line 184, replace
ServerName localhost:80
with
ServerName localhost:81
It is also possible to specify port 81 in the url of your localhost, i.e.
localhost:81/my_project.php
回答2:
1. Go in xampp/apache/conf/httpd.conf
and open it.
In the httpd.conf
file at line 176
Replace
ServerName localhost:80
with
ServerName localhost:81
It will work.
Or 2. Even if the above procedure doesn't work. Then in the same file (httpd.conf
) at line 45 replace
#Listen 0.0.0.0:80 #Listen [::]:80 Listen 80
with
#Listen 0.0.0.0:81 #Listen [::]:81 Listen 81
回答3:
I found that XAMPP control panel under Windows (Windows 7 in my case) does not reflect what is actually going on, unless you start it by "Run as administrator".
回答4:
Accompanying Timmay's answer, You need to do two changes-
Listen 80 --> Listen 81 (near line 58)
ServerName localhost:80 --> ServerName localhost:81 (near line 218)
回答5:
just changed 2 line
Listen 80 to Listen 81 ServerName localhost:80 to ServerName localhost:81
and start using admin privileges
回答6:
Check if you have Skype installed on your machine.
Login and go to Tools - Options - Advanced - Connection and uncheck the box which says use port 80
--
Check if Apache service is already installed by firing up services.msc from run command prompt.
How to delete a service from command prompt? sc delete “serviceName”
Remember serviceName should be replaced by exact name of the Apache service as shown is services list.
Check if IIS is running and taking up port 80. If so, disable it.
--
Check if AVP (Kaspersky) is running and taking up port 80. If so add httpd.exe as an exception to allowed programs.
--
Hope it helps.
回答7:
I have installed VMWare Workstation. So, It was causing the error.
Services.msc and stopped the 'Workstation' Services.
This has solved my problems.
Thanks
回答8:
If you are installed Skype, Please check this option.

Another case is Windows 10
Check this:
- Go to Start, type in services.msc
- Scroll down in the Services window to find the World Wide Web Publishing Service.
- Right-click on it, and select Stop or Disable it if you just want to use XAMPP only.

回答9:
Have you executed "setup_xampp.bat" script? It's inside XAMPP folder and it must be executed every time you change XAMPP folder.
回答10:
i have found that similar issue on my system, and that was from skype installed before xampp installed. i got similar error. for fixing the error i followed these,
- logged out to skype for a while ,
- restarted apache from xampp control panel,
- checked on browser, whether it worked or not, by http://localhost/
- got it worked,
- signed in again to skype,
- all working great, as simple as that
i wasn't need nothing to install or uninstall, and this worked for me in less then 1 minute.
cheers
回答11:
In my case the problem was that both port 80 and 443 were in use: Steps to use to fix it are :
- Open xampp and click on config button
- Now click on ( Appache )httpd.conf (Open in notepad or other editor)
- Now click ctrl + h.
- Find
80
and replace with 8080
- Now save and now click on Appache(httpd-ssl.conf).
- Now find
443
and replace with 4430
. - Now your xampp must be working fine as both these code are never in use by other programs on your system.
Now your localhost will be available as localhost:8080
回答12:
If You installed SQL Express or any .Net Server then you need to stop. open cmd in administrator mode and type this line ...
net stop Was
now start apache
回答13:
If you face this issue directly after a complete new installation on Windows:
It seems like the setup program already starts the http.exe process and blocks the initial port 80 but does not reflect this state in the control panel.
To verify, just test for a running server in your browser. Type into your browser address bar:
localhost
If this displays the XAMPP dashboard, you're fine. Alternatively, check the Task Manager for a running 'Apache HTTP Server' (httpd.exe) process.
You could stop the apache process with the xampp_stop.exe in your xampp base folder. Then, the XAMPP control panel should work as expected.
回答14:
$$$$$$$$ The Best way to do so $$$$$$$$$
The other methods explained above will get you stuck at a lot of places Don't go for changing the port
2 Step Process
1) Open Command Prompt as Administrator
2) type 'net stop http' (If it says it doesn't identify the keyword, then it is only because your Environmental Variable's PATH doesn't contain path to Program Files/System32 you can search on how to do it ) Press Y at every place it asks you to ,Don't Worry You are not stopping any important process just some process which took your port. Annd that process will again take over your port once you are not working.
Enjoy !!
回答15:
I have a solution. I had this problem and research a solution, but i did not succeed. So i downloaded a newer version of XAMPP and clicked on the option netstats within the program.
There he gave me a list of programs and the ports they used and so I looked and had no program using port 80
, but apache beyond 80
also uses port 443
... and there was a program called Pando Media Boster this door, I started the task manager and finished the process of pando Average boster. Hope it helped :).
回答16:
Probably you change configuration file in "httpd-ssl.conf"
DocumentRoot "D:/Server/xServer" ServerName xyz.abc.com SSLCertificateFile "conf/ssl.crt/xyz.crt" SSLCertificateKeyFile "conf/ssl.key/sftaps.in.key"
May be you change certificate name or something in Apache folder.
回答17:
There can be lots of methods to solve this problem, but here is simplest one:
GO to XAMPP-control and...
Run as administrator
That's all..
This is the Golden Point for any such Abnormality.
Concept behind the work
Actually all the services in Xampp need Ports dependency. What happens is, When there is no special powers given to xampp, it only look for some predefined ports to run those services. And, if in case, those ports are somehow already busy... eek! the service couldn't be started.
But if we give superpower to our Xampp-control (by running as administrator), it will somehow manage and for certainly on earth will run the services on the ports. And triumph! You made it.
Permanent tip for my dear Brother and Sisters
To do the efforts one and for all, follow these steps:
- right-click on xampp-control.exe file and go to properties.
- Go to Compatibility Tab.
- In the settings below, choose the checkbox Run this program as an administrator.
- Apply the changes. And you are done.
Now, every time you run the application, it will run with the Administrator status and You don't need to take care about the ports at all.
回答18:
Even if you've configured Apache to listen on another port, you will still get this error if another program is using the default SSL port 443.
What you also need to edit is the http-ssl.conf file and alter the line Listen 443 and change the port number there.
回答19:
I also faced the same problem. And I found an easy and fast solution.
The only thing you need to do is to run XAMPP server as administrator everytime.


enter image description here


回答20:
Salam,
You don't need to change port no.
only go to task manager & end task any other programs that are running.
and then can you START APACHE.......
Sincerely,