【问题标题】:WAMP is not displaying the icons in the directory listingWAMP 未在目录列表中显示图标
【发布时间】:2015-03-23 18:28:58
【问题描述】:

过去我通过 vmware 处理我的 PHP 代码,但我最近决定切换到通过 WAMP(在 Windows 8.1 上)在本地执行它。

  1. 我在www 文件夹中创建了一个空文件夹tests
  2. 然后在我的浏览器上输入http://localhost/tests

一切都很好,只是图标图标不显示。这是一张展示我的意思的图片:

有没有办法让这些图标正确显示?

【问题讨论】:

  • 如果您尝试直接访问这些图标,它们指向的是什么 url,显示的是什么而不是图像?
  • 我不知道,因为这些图标是 wamp 的原生图标。

标签: php permissions wamp


【解决方案1】:

这与 Apache 索引器配置文件有关。它是 Wamp 安装程序的一个错误。它不会修改 httpd-autoindex.conf 配置文件以指向您指定的 Wamp 目录。

查看 httpd-autoindex.conf 并更改路径以指向图标所在的位置。在我的 WampServer 上,它们位于 c:/wamp/bin/apache/apache2.4.9/icons。

这里是你需要更改的 httpd-autoindex.conf 的相关区域:

#Comment out and change below to appropriate icon path
#Alias /icons/ "c:/Apache24/icons/"
Alias /icons/ "c:/wamp/bin/apache/apache2.4.9/icons/"

#Comment out and change below to appropriate icon path
#Directory "c:/Apache24/icons">
<Directory "c:/wamp/bin/apache/apache2.4.9/icons/">
    Options Indexes MultiViews
    AllowOverride None
    Require all granted
</Directory>

默认情况下,WampServer 应该已经在 httpd.conf 中启用了精美的目录列表。如果它们被注释掉,请启用它们:

LoadModule autoindex_module modules/mod_autoindex.so

Include conf/extra/httpd-autoindex.conf

进行这些更改后不要忘记重新启动 Apache。

【讨论】:

  • 你的意思是我要检查我的 httpd.conf 文件?
  • 它解决了我的问题。我感谢您的支持。谢谢
  • 非常感谢...新的 wamp server 3 默认禁用花哨的目录列表,我通过加载 mod_autoindex 解决了这个问题,并在您的回答中包含了 autoindex。
【解决方案2】:

我看到你正在运行 Apache。
确保您的配置文件具有图标的别名,如下所示:

Alias /icons/ "/usr/local/apache/icons/"

【讨论】:

    【解决方案3】:

    我的根目录中有一个目录 icons/,但无法从 icons/ 加载任何内容。它显示服务器图标代替那里的任何东西。

    C:/xampp/apache/conf/extra directory,有httpd-autoindex.conf,这个有别名。

    Alias /icons/ "C:/xampp/apache/icons/"
    

    ...这就是问题所在。

    我不得不把它改成别的东西

    Alias /iconsZ/ "C:/xampp/apache/icons/"
    

    我更改了同一个文件 (httpd-autoindex.conf) 中的所有引用以反映新的 Alias iconsZ/

    【讨论】:

      猜你喜欢
      • 2014-10-04
      • 2016-01-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多