我的机器上安装了 XAMPP。我正在尝试从 XAMPP 控制面板运行 Apache。
我通过右键单击快捷方式并选择“以管理员身份运行”来启动 XAMPP 控制面板(我以具有管理员权限的帐户登录)。控制面板启动,一切正常(没有错误消息/警告)。
当我单击Apache 旁边的开始按钮时,我收到以下错误消息:
2:22:44 PM [Apache] Attempting to start Apache app...
2:22:45 PM [Apache] Status change detected: running
2:22:45 PM [Apache] Status change detected: stopped
2:22:45 PM [Apache] Error: Apache shutdown unexpectedly.
2:22:45 PM [Apache] This may be due to a blocked port, missing dependencies,
2:22:45 PM [Apache] improper privileges, a crash, or a shutdown by another method.
2:22:45 PM [Apache] Check the "/xampp/apache/logs/error.log" file
2:22:45 PM [Apache] and the Windows Event Viewer for more clues
请注意,它告诉我 Apache 已意外关闭并检查 error.log 文件和 Windows 事件查看器。
我检查了 error.log 文件,但它是空的:
我还使用 Windows 事件查看器检查了任何事件,但事件查看器未显示任何事件(在应用程序下):
我检查了可能阻塞端口等的程序(如 Skype、Visual SVN 服务器)并关闭了所有可能导致问题的程序。
我还能做些什么来找出可能发生的事情吗?
谢谢你。
更新
我通过尝试从 DOS 命令提示符运行 apache 解决了这个问题。从命令提示符运行给了我特定的错误以及这些错误在 httpd.conf 文件中的位置。事实证明,我的ServerRoot和DocumentRoot值不正确(指向错误的目录)。我将它们更改为指向正确的目录,现在我可以从控制面板启动 apache。
很好奇,为什么我从控制面板启动时没有看到有关ServerRoot和DocumentRoot的错误消息?