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

我怎么解决这个问题?


当前回答

对我来说,这要容易得多。我关闭了本地windows防火墙。然后重新加载comp启动xampp并再次启动apache。然后把防火墙重新打开。

其他回答

如果你用的是Windows 7。在Windows搜索中搜索IIS(单击左下角的窗口图标,并键入“搜索程序和文件”)。

打开IIS (Internet信息服务)。

在右侧的操作面板。单击停止。

注意:停止链接在屏幕截图中是褪色的。就像我阻止了它一样。 问题解决了!

最好的解决方案

打开XAMPP控制面板,单击Apache的config,然后单击Apache(httpd.config)。现在在文本编辑器中。ctrl+f—>找到“Listen 80”,并将其替换为“Listen 8079”,不带引号:) 但是现在你必须像这样使用它http://localhost:8079/

p.s.,我试图改变skype的端口设置,停止我在windows 10中找不到的Web部署代理服务,cmd——> net stop http和其他方法,但除了这个没有任何工作。

开放的Skype。

工具—>选项—>高级—>连接。

取消选中“使用端口80和443作为传入连接的替代”复选框

退出并关闭所有Skype窗口。尝试重新启动Apache。

好吧,没有端口80,没有Skype的指责!我的问题确实很简单(也很愚蠢), 在我为DocumentRoot指令指定的路径之后,我有一个额外的反斜杠(\)(在Windows上),所以我做了这样的更改,问题就像鸭汤一样消失了。

我的index.php在路径“D:\ sites\dummy”和我的httpd.conf是这样的:

<VirtualHost 127.0.0.2:80>
ServerName dummy.local
DocumentRoot "D:\websites\dummy\" #mistake here
</VirtualHost>
<Directory "D:\websites\dummy\"> #mistake here
    Require all granted
</Directory>

所以就像这样改变这两行:

#first mistake fix:
DocumentRoot "D:\websites\dummy"
#second (similar) mistake fix:
<Directory "D:\websites\dummy">

...现在一切都好了。为了防止将来发生这样的错误,总是复制任何你想要引用的文件夹的路径,而不是自己输入。

Apache服务器默认运行在80、443端口上。您的问题是两个端口中的一个或两个都忙。通常Skype或VMware Workstation使用这两个端口。所以,确保它们没有在运行。确保端口在windows上是空闲的最好方法是:

单击“窗口”按钮。 在搜索栏中输入resmon,打开资源监视器resmon.exe。 Open Listening Ports,这将显示打开的已使用端口。 现在您可以看到哪个进程正在使用端口80和443。 然后,您可以从CMD中使用进程的PID(在资源监视器中显示)终止进程,或者直接从任务管理器中终止进程。 使用PID类型Taskkill /PID 26356 /F从CMD中终止进程,其中26356是PID。