简体   繁体   English

Windows XP上Apache中的“DocumentRoot必须是目录”错误

[英]“DocumentRoot must be a directory” error in Apache on Windows XP

I try to setup Apache (part of EnterpriseDB ApachePHP package) for localhost. 我尝试为localhost设置Apache(EnterpriseDB ApachePHP包的一部分)。 But Apache won't start since the first restart (after initial configuration). 但Apache自第一次重启(初始配置后)后才会启动。 Httpd.exe complains that "DocumentRoot must be a directory" - but it IS a directory, and Apache even recognized it as such before the first restart. Httpd.exe抱怨“DocumentRoot必须是一个目录” - 但它是一个目录,Apache甚至在第一次重启之前就认出了它。 This problem persists even when I change the DocumentRoot back to its default directory. 即使我将DocumentRoot更改回其默认目录,此问题仍然存在。

The problematic line looks like this: DocumentRoot "d:\\www\\" When changing the backslashes to slashes or deleting the trailing backslash httpd.exe works forever and never reaches any result, so I understand that this is the correct format. 有问题的行看起来像这样: DocumentRoot "d:\\www\\"当将反斜杠更改为斜杠或删除尾部反斜杠httpd.exe永远工作并且永远不会达到任何结果时,所以我理解这是正确的格式。

There is a good question on this: Apache restart causes DocumentRoot must be a directory, even though it is a directory and there seem to be no privilege issues . 有一个很好的问题: Apache重启导致DocumentRoot必须是一个目录,即使它是一个目录,似乎没有特权问题 Unfortunately, I believe its solution is not applicable to my case: on Windows XP (32 bit) there is no SELinux to disable. 不幸的是,我认为它的解决方案不适用于我的情况:在Windows XP(32位)上没有SELinux禁用。

The last action I did before the restart was enabling (uncommenting) php_gd2 library in php.ini. 我在重启之前做的最后一个动作是在php.ini中启用(取消注释)php_gd2库。 Reverting this didn't make Apache work, so I guess this is not the reason. 恢复这个并没有使Apache工作,所以我猜这不是原因。 This (and the root directory in httpd.conf) was the only change I did, otherwise I accepted EDB's defaults. 这(以及httpd.conf中的根目录)是我做的唯一更改,否则我接受了EDB的默认值。

Any ideas what to do now? 任何想法现在该做什么?

I have reinstalled EnterpriseDB Apache PHP and now it seems to work fine. 我重新安装了EnterpriseDB Apache PHP,现在看起来工作正常。 The correct format is with no trailing slash - under this configuration server is running now, and when I execute httpd.exe in command line, it shows some log in less than a minute (not "still working after an hour"). 正确的格式没有斜杠 - 在此配置下服务器现在正在运行,当我在命令行中执行httpd.exe时,它会在不到一分钟的时间内显示一些日志(不是“一小时后仍在工作”)。 I don't know what caused the problem, but it is solved. 我不知道是什么原因引起了这个问题,但它已经解决了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM