我刚刚重新安装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

我怎么解决这个问题?


当前回答

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

其他回答

我的例子很简单。

我在我的以太网端口上设置了一个本地IP地址。

然后出现这个错误。结果我并没有连接 将电缆连接到它,因此IP不会解析为Apache中的IP集。

解决方案是将电缆连接到交换机或路由器。然后可以启动Apache。

注意,无论何时更改默认端口,浏览器都不会知道。80和443似乎在某种程度上是标准的,例如,如果您将80更改为8080,那么您将不得不以这种方式访问您的网站:

localhost: 8080 / path_to_your_website.php

发生这种情况是因为默认端口80被Apache阻塞。您需要更改端口或使端口可访问。

转到Apache安装中的Apache配置(httpd.conf)文件。

找到这些台词:

#

听192.168.1.2:80

听80

#

这里192.168.1.2是我的私有IP地址。根据你的改变。

变更如下

听192.168.1.2:8081

听8081

现在,当您访问localhost时,您必须显式地将端口添加为 http://localhost: 8081 /…

In my case I edited the http.conf file for I wanted localhost to be accessible by other computers on the network and did not set a static IP on my network adapter. I also checked netstat and saw nobody was using port 80. So I opened cmd and typed ipconfig I also opened the http.conf and searched(CTRL + F) for "Listen 80". The line above it, if not commented, enables localhost to be accessible over the network. It should look something like this:Listen 192.168.93.3:80 Comparing the result from ipconfig command, I saw that my current ip address isn't the same as the one on the http.conf file. So I changed the ip address on the http.conf file with the one currently assigned to me and it worked.

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

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

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