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

我怎么解决这个问题?


当前回答

由于我在一个开发人员面临防火墙问题的企业环境中工作,其他答案都不能解决我的问题。

由于Skype不使用该端口,而是由其他一些内部应用程序使用, 我按照以下步骤来解决这个问题:

步骤1 -从XAMPP控制面板,在Apache下,单击Config按钮,并选择Apache (httpd.conf)。

在httpd.conf文件中,我发现了一行说:

Listen 80

然后把80换成任何你想要的数字/端口。在我的场景中,我使用端口8080。

Listen 8080

仍然从httpd.conf文件,我发现另一行说:

ServerName localhost:80

将80修改为8080。

ServerName localhost:8080

步骤2 -从XAMPP控制面板,在Apache下,再次单击Config按钮,但这次选择Apache (httpd-ssl.conf)。在httpd-ssl.conf文件中,找到这样一行

Listen 443

并将443更改为您想要的任何数字/端口。我将使用4433作为新的端口号。

Listen 4433

仍然从httpd-ssl.conf文件中,找到另一行说

<VirtualHost _default_:443>

ServerName localhost:443

将443改为4433。

<VirtualHost _default_:4433>

ServerName localhost:4433

记得在进行一些更改后保存httpd.conf和httpd-ssl.conf文件。然后重新启动Apache服务。

其他回答

我有一个类似的错误,改变端口或运行为管理员不工作。 我用的是Windows 10。 我从xampp目录运行apache_start.bat,我得到了一个更具体的反馈,说我的https-vhosts.conf文件上有一个错误,特别是在文档根目录的末尾有一个额外的\。把它拿开,它又工作了。

发生这种情况是因为默认端口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 /…

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

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

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

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

首先,我尝试卸载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的链接

似乎没有人回答关于执行xampp_start.exe的问题。

我做了所有以前的答案,但它没有解决我的问题。我发现运行xampp_start.exe将为您提供有关该问题的详细信息。

这是我在我这边看到的

正如你所看到的,我有一个路径问题或xampp指向不存在的文件夹。