Apache 目录列表不起作用

发布于 2024-10-31 05:40:46 字数 736 浏览 3 评论 0 原文

我刚刚手动安装了 ApachePHP,除了一件事之外一切都工作正常:我无法获取目录列表或打开任何文件。一个小问题。

如果我将根目录更改为 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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

暖阳 2024-11-07 05:40:46

确保您没有类似的指令

Options -Indexes

,并且模块 mod_autodindex 已加载(http:// httpd.apache.org/docs/2.0/mod/mod_autoindex.html

这也可能是由于父目录没有将选项中的索引和AllowOverride设置为“无”,如下所示:

<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>

make sure you have no directive like

Options -Indexes

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:

<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>
爱要勇敢去追 2024-11-07 05:40:46

啊。完整的新手错误。我试图删除这个问题,但它不让我删除。

我没有更改 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*

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文