我刚刚重新安装XAMPP,当我试图在XAMPP控制面板中启动我的Apache服务器时,我现在得到以下错误:

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

我怎么解决这个问题?


当前回答

我收到了与OP完全相同的错误消息,但现有的任何答案都没有解决我的问题。许多答案涉及端口80上的冲突,我知道我没有冲突,因为我最近在端口80上有localhost响应。

结果我无意中改变了ServerRoot,当我打算改变DocumentRoot(愚蠢,我知道),虽然新的ServerRoot目录存在,但它不包含配置文件和apache所需的其他东西,这导致它在启动时失败。错误消息可能通过“缺少依赖项”来解决这种情况。

在我的Windows系统上,将ServerRoot设置回C:/XAMPP/apache解决了这个问题。

其他回答

在XAMPP控制面板V3.2.1中,单击右上角的“NetStat”按钮。确保端口80没有被任何其他程序使用。然后点击它下面的“Shell”。在shell提示符中发出这个命令;

Apache_Start.bat

或者输入“ap”,然后按tab键两次,这将类似地生成上述命令。 您将看到Apache失败的确切错误。这很可能是虚拟主机配置问题或其他问题。它将显示发生错误的行号。只需要修复这个错误。注意,在RootDocument中,尾随的\也可能是错误的来源。删除任何拖尾""。

在我的情况下,这发生在安装sql server和解决方案是在这个答案中描述

Xampp -安装SQL Server和Visual Studio后无法启动Apache

所以我不得不从Windows服务中禁用“SQL Server Reporting Services”服务

试试下面的方法,上面的方法都不能解决我的问题

选择“以管理员身份运行”

然后点击Apache旁边的左边大框

并选择卸载Apache

我不知道为什么这样做,但它直接解决了我的问题!

原因之一可能是您不是以管理员身份运行XAMPP控制面板。

即使我也有这个问题,我解决了,在我的情况下,它是不同的。

首先,我尝试卸载skype,但没有工作。但是在我的windows 10桌面中,我默认安装了IIS(Internet Information Server),指向80端口。

我所做的就是将端口号更改为8081,并重新启动XAMPP,这对我来说很有效。

但是我没有使用IIS。

这里是https://support.microsoft.com/en-in/help/149605/how-to-change-the-tcp-port-for-iis-services的链接