我刚刚手动安装了 Apache 和 PHP,除了一件事之外一切都工作正常:我无法获取目录列表或打开任何文件。一个小问题。
如果我将根目录更改为 Apache 目录中的 htdocs,它可以正常工作,但当我将其更改为我想要的目录时,它就无法工作。
我已将 PHP 安装在 F:\PHP
中,将 Apache 安装在 F:\Program Files\Apache
中,我的根目录是 F:\www< /code> (最后一件事就是问题所在)。
这是我的 httpd.conf
<Directory "F:/www">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
目录的一个片段,其中包含 test.php,当我尝试其中一个时,我收到 403 Forbidden 错误。
如果我将行
更改为指向上面提到的 htdocs 目录并重新启动 Apache,它就可以正常工作。为什么它不喜欢F:/www?
我做错了什么?谢谢!
I've just manually installed Apache and PHP, and everything is working fine apart from one thing: I can't get a directory listing or open any files. A slight problem.
It works fine if I change my root to the htdocs in my Apache directory, but it refuses to work when I change it to the directory I want.
I've PHP installed in F:\PHP
, I have Apache installed in F:\Program Files\Apache
, and my root is F:\www
(this last thing is the problem).
Here's a snippet of my httpd.conf
<Directory "F:/www">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
The directory exists with test.php in it and I get 403 Forbidden error when I try either.
If I change the line <Directory "F:/www">
to point to the htdocs directory mention above and restart Apache, it works fine. Why doesn't it like F:/www?
What have I done wrong? Thanks!
发布评论
评论(2)
确保您没有类似的指令
,并且模块 mod_autodindex 已加载(http:// httpd.apache.org/docs/2.0/mod/mod_autoindex.html)
这也可能是由于父目录没有将选项中的索引和AllowOverride设置为“无”,如下所示:
make sure you have no directive like
and that the module mod_autodindex is loaded (http://httpd.apache.org/docs/2.0/mod/mod_autoindex.html)
It may also be due to a parent directory without the Indexes in Options and AllowOverride set to None, like this:
啊。完整的新手错误。我试图删除这个问题,但它不让我删除。
我没有更改 HTTPD.CONF 中的
DocumentRoot
,只是添加了
语句。现在效果很好。
*捂脸*
Ugh. Complete newb error. I tried to delete the question, but it won't let me.
I didn't change
DocumentRoot
in the HTTPD.CONF, I only added a<directory>
statement.Now it works fine.
*facepalm*