我刚刚重新安装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的视频)
好吧,没有端口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">
...现在一切都好了。为了防止将来发生这样的错误,总是复制任何你想要引用的文件夹的路径,而不是自己输入。