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

我怎么解决这个问题?


当前回答

步骤1:在Apache进入Config,然后选择Apache(httpd.conf)

在记事本中,找到Listen 80并添加另一个80以将端口更改为Listen 8080

请确保在关闭记事本之前保存。

步骤2:在Apache中选择Apache(httpd-ssl.conf)

在记事本中,找到Listen 443,并在443之后再添加3,将端口更改为Listen 4433

然后搜索“VirtualHost default:443”,再添加3,将端口修改为“VirtualHost default:4433”

请确保在关闭记事本之前保存。

(注:这里有一个类似的答案,但它并不适用于我,直到我喜欢YT的视频)

其他回答

我试了所有的办法,但我的问题还是没有解决。事实证明,在安装Visual Studio 2019之后,我的c++可重分发文件发生了很多变化。

我实际上在跑步

test_php.bat

它告诉了我错误是什么

C:\Windows\SYSTEM32\VCRUNTIME140.dll' 14.0与此PHP构建不兼容,该PHP构建在未知的第0行中链接到14.28

因此,我开始了:

微软Visual Studio网站->其他工具,框架,和 > Microsoft Visual c++ Redistributable for Visual Studio 2019

和下载。安装文件并重新启动我的电脑后,问题就解决了。Apache现在可以正常运行了

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

步骤1:在Apache进入Config,然后选择Apache(httpd.conf)

在记事本中,找到Listen 80并添加另一个80以将端口更改为Listen 8080

请确保在关闭记事本之前保存。

步骤2:在Apache中选择Apache(httpd-ssl.conf)

在记事本中,找到Listen 443,并在443之后再添加3,将端口更改为Listen 4433

然后搜索“VirtualHost default:443”,再添加3,将端口修改为“VirtualHost default:4433”

请确保在关闭记事本之前保存。

(注:这里有一个类似的答案,但它并不适用于我,直到我喜欢YT的视频)

对我来说,万维网发布服务使用的是80端口。我通过在cmd上运行以下命令来杀死它:

net stop http

在那之后,XAMPP运行Apache没有任何问题。

我以前也遇到过同样的问题。我有一台旧笔记本电脑,上面几乎所有的端口不是被阻塞就是故障了。我是这么做的。

打开XAMPP控制面板。 点击Config 然后进入Apache httpd.conf文件。用文本编辑器打开它。 搜索“80”(按Ctrl + F并找到所有它们。将其替换为8080或4040或4000)。 保存文件。并重新启动XAMPP。

它对我很有效,我希望它也能帮助到你。