Apache 无法启动 - ServerRoot 必须是有效目录并且无法找到指定的模块

标签 apache httpd.conf

我正在使用 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/

相关文章:

regex - 重写规则以排除静态文件,例如 woff 和 tff

apache - Apache网络服务器中的KeepAliveTimeout 0

php - 在 apache 中限制从 Internet 访问

php - htaccess - 重写具有相同名称目录的文件

linux - 使用 httpd 进行 URL 屏蔽

php - 在 apache 网络服务器上使用 Ratchet websocket 库为安全 websocket 配置虚拟主机

php - Codeigniter Htaccess 和 URL 重定向问题

php - 如何在本地使用 XAMPP 设置 F3?

php - 更改 php.ini 文件后是否需要重新启动 Apache?

apache - Apache 中的快速 CGI : Couldn't bind unix domain socket