我刚刚重新安装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解决了这个问题。

其他回答

首先,您应该验证httpd-vhosts文件中没有多余的虚拟主机。我的意思是遵循简单的规则:在配置文件中,1个项目= 1个虚拟主机。否则,即使您更改端口等,也会面临错误。

在我的情况下,端口已经被windows IIS服务使用。 您可以从cmd检查端口是否已被使用。打开cmd,执行如下命令:

netstat -ano

如果IIS正在使用它,可以通过以下命令停止它。以管理员身份打开cmd,然后:

iisreset /stop

现在尝试运行XAMPP,它应该可以工作。

我通过停止“Web部署代理服务”解决了这个问题。打开:System -> Computer Management -> Services -> Web部署代理服务。停止此服务并启动XAMPP工作。 我想这是MS Webmatrix提供的一项服务。

>系统和保安>管理>服务>网络调送服务

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

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

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

下载新的xampp apachefriends 安装它 删除所有VPN应用程序 打开XAMPP文件夹运行setup_xampp.bat 运行xampp-control.exe