Apache 无法启动 - ServerRoot 必须是有效目录并且无法找到指定的模块 [英] Apache could not be started - ServerRoot must be a valid directory and Unable to find the specified module
问题描述
我正在使用 xampp 便携式服务器,但我在使用 Apache http 服务器时遇到了一些问题,它说ServerRoot 必须是有效目录"
I'm using xampp portable server and I'm having some trouble with Apache http server, it says "ServerRoot must be a valid directory"
命令行输出:
Please close this command only for Shutdown
Apache 2 is starting ...
httpd.exe: Syntax error on line 35 of K:/../../../xampp/apache/conf/httpd.conf: ServerRoot must be a valid directory
Apache could not be started
我检查了 xampp/apache/conf/httpd.conf 的第 35 行,结果是:
I checked the line 35 of xampp/apache/conf/httpd.conf and it was:
ServerRoot "/xampp/apache"
不存在的.我的文件夹是:
Which doesn't exist. My folders are:
K:/../../../xampp/apache/conf <- where the httpd.conf is
K:/../../../xampp/apache/ <- the server root
K:/../../../xampp/apache/modules <- where server modules are
如果我将(在第 35 行)更改为
If i change (at line 35) to
ServerRoot ".."
它说:
Please close this command only for Shutdown
Apache 2 is starting ...
httpd.exe: Syntax error on line 65 of K:/../../../xampp/apache/conf/httpd.conf: Cannot load modules/mod_access_compat.so into server: Unable to find the specified module
Apache could not be started
我检查过,modules/mod_access_compat.so 存在,所以我不知道如何修复它.
I checked, and modules/mod_access_compat.so exists, so i can't figure out how to fix it.
任何帮助将不胜感激
推荐答案
只需从 shell(来自 XAMPP 控制面板的 shell)运行 setup_xampp.bat,路径应该会自动设置为 XAMPP for windows 的便携式版本.它对我有用.
Just run setup_xampp.bat from shell (shell from XAMPP control panel)and the paths should be set automatically for the portable version of XAMPP for windows. It has worked for me.
这篇关于Apache 无法启动 - ServerRoot 必须是有效目录并且无法找到指定的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!