xampp安装后运行apache出错

Posted

技术标签:

【中文标题】xampp安装后运行apache出错【英文标题】:error running apache after xampp install 【发布时间】:2014-07-28 15:34:08 【问题描述】:

我在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

以下链接对我没有帮助

Why won't Apache start in XAMPP installation?

这是错误日志

[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.

【问题讨论】:

我在那个错误中没有看到任何 apache 的条目 你试过以管理员身份运行它吗? 是的,对不起,我复制了错误的错误代码,因为现在它是 apache.running 管理员中的什么?这只是我的本地电脑 【参考方案1】:

试试这些方法,应该可以的:

退出/退出 Skype(确保它没有运行),因为它保留了 localhost:80 禁用防病毒(先尝试禁用Skype并再次运行,如果不起作用则执行此步骤) 右击xampp控制面板,以管理员身份运行

【讨论】:

我真的被困在这里了。我在卸载 easyphp 后刚刚安装了 xampp,但我没有 Skype,也没有看到任何 apache 服务可以启动?我有 xamp 控制面板,它会在启动时出错 @ajt 您是否尝试禁用防病毒然后运行 ​​apache 服务器? 通常不是。禁用防病毒和Skype并尝试右键单击xampp控制面板并以管理员身份运行@ajt 它现在可以在重新启动后以管理员身份运行。有没有办法不以管理员身份运行?我要自动启动 @ajt 转到控制面板> 服务-> 右键单击​​并将手动更改为自动或类似我不记得 100% 的选项【参考方案2】:

我遇到了同样的问题,我解决了更改端口的问题。 -> 点击 Apache 前面的按钮 Config。 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 运行 xammphttp://localhost:8081/ 您必须提供您提供的端口号才能输入本地主机 希望这可以帮助您了解正在发生的事情。

【讨论】:

有没有人解释一下这个更新会带来什么样的变化。究竟会发生什么? 您好,您在与 Skype 相同的端口上运行 Apache。 Skype 和 Apache 一样默认使用 443 端口,因此如果您更改端口,您将能够正确使用 Apache。【参考方案3】:

在 Windows 10 上安装 xampp 时,我遇到了同样的错误。

www.example.com:443:0 服务器证书不包含 与服务器名称匹配的 ID

所以我在 xampp 文件夹中打开了httpd-ssl.conf 文件并更改了以下行

ServerName www.example.com:443

ServerName localhost

问题就解决了。

【讨论】:

【参考方案4】:

我认为杀死使用该端口的进程比更改配置文件中的端口更容易处理。这是在 Windows 中执行此操作的方法。您可以对 Linux 执行相同的过程,但使用不同的命令。 以管理员身份运行命令提示符。然后键入以下命令以找出所有使用该端口的进程。

netstat -ano

会有大量进程使用各种端口。因此,要仅获取端口,我们需要使用findstr,如下所示(这里我使用端口 80)

netstat -ano | findstr 80

这会给你这样的结果

TCP    0.0.0.0:80             0.0.0.0:0              LISTENING       7964

最后一个数字是进程的进程ID。所以我们要做的是使用 PID 杀死进程,我们可以使用taskkill 命令。

taskkill /PID 7964 /F

再次运行您的服务器。这一次它将能够运行。这也可以用于 mysql 服务器。

【讨论】:

你的问题不清楚。您是在问“系统是否是侦听端口的系统”?【参考方案5】:

www.example.com:443:0 服务器证书不包含与服务器名称匹配的 ID

我在尝试启动 Apache 时遇到此错误,Apache 没有错误。这是 Windows 8 上的依赖错误 - 可能与 7 相同。只需右键单击并以管理员身份运行 :)

如果您仍然收到错误,请检查您的防病毒/防火墙是否阻止 Xampp 或端口 443。

【讨论】:

【参考方案6】:

将主端口从 80 更改为 8080 后,您必须更改 XAMPP 控制面板中的配置,如图所示:

1)

2)

3)

然后重启服务就可以了!

【讨论】:

以上是关于xampp安装后运行apache出错的主要内容,如果未能解决你的问题,请参考以下文章

在 XAMPP 中配置 tomcat 时出错

apache 运行一段时间后自动出错了

使用 XAMPP apache 服务器 Laravel 8 时调用路由时出错

已安装 apache 和 mysql 的 XAMPP

在 Mac OS Lion 上使用 XAMPP 安装 MongoDb PHP 驱动程序时出错

运行 xampp 的问题