MySQL 安装 xampp 后运行 apache 时出错
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24097498/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
error running apache after xampp install
提问by ajt
I installed xampp on win7 and get this error when starting apache. I unchecked skype and nothing changes. How do I find what is using port 80? How do I fix this please. I dont have another server running.
我在 win7 上安装了 xampp 并在启动 apache 时出现此错误。我取消了Skype,没有任何变化。如何找到正在使用端口 80 的内容?我该如何解决这个问题。我没有运行另一台服务器。
update this is the error. I click on start and get this problem
Error: Apache shutdown unexpectedly.
11:27:19 PM [Apache] This may be due to a blocked port, missing dependencies,
11:27:19 PM [Apache] improper privileges, a crash, or a shutdown by another method.
11:27:19 PM [Apache] Press the Logs button to view error logs and check
11:27:19 PM [Apache] the Windows Event Viewer for more clues
11:27:19 PM [Apache] If you need more help, copy and post this
11:27:19 PM [Apache] entire log window on the forums
The below link didnt help me
下面的链接没有帮助我
Why won't Apache start in XAMPP installation?
Here is the error log
这是错误日志
[Sat Jun 07 22:36:53.823331 2014] [ssl:warn] [pid 6048:tid 236] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Jun 07 22:36:54.084345 2014] [ssl:warn] [pid 6048:tid 236] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Jun 07 22:36:55.240412 2014] [mpm_winnt:notice] [pid 6048:tid 236] AH00455: Apache/2.4.9 (Win32) OpenSSL/1.0.1g PHP/5.5.11 configured -- resuming normal operations
[Sat Jun 07 22:36:55.241412 2014] [mpm_winnt:notice] [pid 6048:tid 236] AH00456: Apache Lounge VC11 Server built: Mar 16 2014 12:13:13
[Sat Jun 07 22:36:55.241412 2014] [core:notice] [pid 6048:tid 236] AH00094: Command line: 'E:\xampp\apache\bin\httpd.exe -d E:/xampp/apache'
[Sat Jun 07 22:36:55.339417 2014] [mpm_winnt:notice] [pid 6048:tid 236] AH00418: Parent: Created child process 1840
[Sat Jun 07 22:36:55.950452 2014] [ssl:warn] [pid 1840:tid 248] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Jun 07 22:36:56.202467 2014] [ssl:warn] [pid 1840:tid 248] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sat Jun 07 22:36:56.299472 2014] [mpm_winnt:notice] [pid 1840:tid 248] AH00354: Child: Starting 150 worker threads.
回答by CMPS
Try those methods, it should work:
尝试这些方法,它应该有效:
- quit/exit Skype(make sure it's not running) because it reserves localhost:80
- disable Anti-virus (Try first to disable skype and running again, if it didn't work do this step)
- Right click on xampp control panel and run as administrator
- 退出/退出Skype(确保它没有运行),因为它保留了 localhost:80
- 禁用防病毒(首先尝试禁用Skype并再次运行,如果它不起作用,请执行此步骤)
- 右键单击 xampp 控制面板并以管理员身份运行
回答by Carlos H
I had the same problem, I solved changing the ports.
-> Clicked button Configfront of Apache.
1) Select Apache (httpd.conf)
2) searched for this line: Listen 80
3) changed for this: Listen 8081
4) saved file
-> Click Configbutton front of Apache.
1) Select Apache (httpd-ssl.conf)
2) searched for this line: Listen 443
3) changed for this: Listen 444
4) saved file
I can run xammp from port 8081
http://localhost:8081/
You have to give port number you gave to enter the localhost
Hope this helps you to understand what is happening.
我遇到了同样的问题,我解决了更改端口的问题。
-> 单击Apache 前面的按钮配置。
1) 选择Apache (httpd.conf)
2) 搜索到这一行:Listen 80
3) 改成:Listen 8081
4) 保存文件
->点击Apache 前面的Config按钮。
1) 选择Apache (httpd-ssl.conf)
2) 搜索这一行:Listen 443
3) 为此更改:Listen 444
4) 保存的文件
我可以从端口 8081 运行 xammp
http://localhost:8081/
你必须提供您为输入本地主机而提供的端口号
希望这可以帮助您了解正在发生的事情。
回答by Waqas Bukhary
I got the same error when xampp was installed on windows 10.
在 Windows 10 上安装 xampp 时,我遇到了同样的错误。
www.example.com:443:0 server certificate does NOT include an ID which matches the server name
www.example.com:443:0 服务器证书不包含与服务器名称匹配的 ID
So I opened httpd-ssl.conf
file in xampp folder and changed the following line
所以我httpd-ssl.conf
在 xampp 文件夹中打开文件并更改了以下行
ServerName www.example.com:443
To
到
ServerName localhost
And the problem was fixed.
问题得到了解决。
回答by Menuka Ishan
I think killing the process which is uses that port is more easy to handle than changing the ports in config files. Here is how to do it in Windows. You can follow same procedure to Linux but different commands. Run command prompt as Administrator. Then type below command to find out all of processes using the port.
我认为杀死使用该端口的进程比更改配置文件中的端口更容易处理。以下是如何在 Windows 中执行此操作。您可以对 Linux 执行相同的步骤,但使用不同的命令。以管理员身份运行命令提示符。然后键入以下命令以查找使用该端口的所有进程。
netstat -ano
There will be plenty of processes using various ports. So to get only port we need use findstr
like below (here I use port 80)
将有大量进程使用各种端口。所以为了只获取我们需要使用的端口,findstr
如下所示(这里我使用端口 80)
netstat -ano | findstr 80
this will gave you result like this
这会给你这样的结果
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 7964
Last number is the process ID of the process. so what we have to do is kill the process using PID we can use taskkill
command for that.
最后一个数字是进程的进程 ID。所以我们要做的就是使用 PID 终止进程,我们可以使用taskkill
命令来完成。
taskkill /PID 7964 /F
Run your server again. This time it will be able to run. This can uses for Mysql server too.
再次运行您的服务器。这一次它将能够运行。这也可以用于 Mysql 服务器。
回答by LinuxLeprechaun
www.example.com:443:0 server certificate does NOT include an ID which matches the server name
www.example.com:443:0 服务器证书不包含与服务器名称匹配的 ID
I was getting this error when trying to start Apache, there is no error with Apache. It's an dependency error on windows 8 - probably the same for 7. Just right click and run as Admin :)
尝试启动 Apache 时出现此错误,Apache 没有错误。这是 Windows 8 上的依赖错误 - 可能与 7 相同。只需右键单击并以管理员身份运行 :)
If you're still getting an error check your Antivirus/Firewall is not blocking Xampp or port 443.
如果您仍然收到错误,请检查您的防病毒软件/防火墙是否阻止了 Xampp 或端口 443。