我刚刚重新安装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或VMware是否安装在您的机器上。
Skype使用端口80和443作为传入连接的附加端口。如果需要在Skype中修改端口号,请转
工具>连接选项>连接
在Skype窗口。现在将默认的80端口号更改为其他端口号。
VMware Workstation使用443端口进行共享。要改变这一点,打开VMware工作站,然后转到
编辑>首选项>共享虚拟机
点击“更改设置”按钮
然后点击“禁用共享”
然后更改正在使用的https端口号(443)
然后点击“启用共享”按钮
这就是你要做的。重新启动XAMPP并运行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">
...现在一切都好了。为了防止将来发生这样的错误,总是复制任何你想要引用的文件夹的路径,而不是自己输入。