我正在使用 xampp 可移植服务器,我在使用 Apache http 服务器时遇到了一些问题,它说“ServerRoot 必须是一个有效的目录”
命令行输出:
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 行,它是:
ServerRoot "/xampp/apache"
哪个不存在。我的文件夹是:
K:/../../../xampp/apache/conf <- where the httpd.conf is
K:/../../../xampp/apache/ <- the server root
K:/../../../xampp/apache/modules <- where server modules are
如果我将(在第 35 行)更改为
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 存在,所以我不知道如何修复它。
任何帮助将不胜感激
最佳答案
只需从 shell(XAMPP 控制面板中的 shell)运行 setup_xampp.bat,路径应该为 Windows 的 XAMPP 可移植版本自动设置。它对我有用。
关于Apache 无法启动 - ServerRoot 必须是有效目录并且无法找到指定的模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14548768/