Apache 在 xampp 版本 3.2.2 中不工作

当我使用 XAMPP v3.2.2 启动 apache 服务器时,它带有一条错误消息:

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

然后我进入错误文件位,它说:

[Wed Dec 30 18:12:12.892830 2015] [ssl:warn] [pid 11372:tid 512] AH01909: www.example.com:443:0 server certificate does NOT include anID which matches the server name 
[Wed Dec 30 18:12:13.066839 2015] [ssl:warn] [pid 11372:tid 512] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name 
[Wed Dec 30 18:12:13.134845 2015] [mpm_winnt:notice] [pid 11372:tid 512] AH00455: Apache/2.4.18 (Win32) OpenSSL/1.0.2e PHP/7.0.0 configured -- resuming normal operations 
[Wed Dec 30 18:12:13.134845 2015] [mpm_winnt:notice] [pid 11372:tid 512] AH00456: Apache Lounge VC14 Server built: Dec  9 2015 10:17:39 
[Wed Dec 30 18:12:13.134845 2015] [core:notice] [pid 11372:tid 512] AH00094: Command line: 'C:xamppapachebinhttpd.exe -d C:/xampp/apache' 
[Wed Dec 30 18:12:13.142847 2015] [mpm_winnt:notice] [pid 11372:tid 512] AH00418: Parent: Created child process 4144 
[Wed Dec 30 18:12:13.900887 2015] [ssl:warn] [pid 4144:tid 564] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name 
[Wed Dec 30 18:12:14.074292 2015] [ssl:warn] [pid 4144:tid 564] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name 
[Wed Dec 30 18:12:14.134295 2015] [mpm_winnt:notice] [pid 4144:tid 564] AH00354: Child: Starting 150 worker threads.

我很困惑,不知道如何解决它。

stack overflow Apache Not working in xampp version 3.2.2
原文答案

答案:

作者头像

如果您的 Skype 已打开 - 您可能会退出程序,因为 Skype 正在使用端口 80

作者头像

经过一番研究,我发现 Win 10 可能在端口 80 上运行了一项服务,名为“万维网发布服务”。您需要做的是停止此服务或更改 Apache 端口,如下所示:

尝试这个:

Method 1. Changing Apache default port:

  • 在文本或代码编辑器上打开文件 httpd.config - 它应该位于 C:xamppapacheconfhttpd.conf
  • 搜索“听 80”。
  • 将 80 更改为任何其他端口号,例如– 9080
  • 启动 XAMPP。

要访问您的本地主机,请打开您的浏览器并输入: localhost:9080/sitefolder/ 而不仅仅是 localhost/sitefolder/

那你应该没事。

如果还是不行,重复同样的过程,再次将端口更改为 80,然后继续方法 2。

Method 2: Stop World Wide Web Publishing Service.

注意:除非您正在运行一些依赖于 Microsoft IIS Web 服务器的软件,否则在停止它时应该没问题。

要停止此服务,您可以遵循此 video tutorial