WAMP is not displaying the icons in the directory listing

落花浮王杯 提交于 2019-12-21 21:38:50

问题


In the past I have worked with my PHP code through vmware, but I recently decided to switch to doing it locally through WAMP (on Windows 8.1).

  1. I created an empty folder tests in the www folder.
  2. Then on my browser, I typed http://localhost/tests

Everything is fine except that the icons icons are not displayed. Here is a picture demonstrating what I mean:

Is there a way to get these icons to display correctly?


回答1:


This has to do with the Apache indexer config file. Its a bug with the Wamp installer. It does not modify the httpd-autoindex.conf configuration file to point to the Wamp directory you specified.

Look in httpd-autoindex.conf and change the paths to point to where the icons are located. On my WampServer, they are located in c:/wamp/bin/apache/apache2.4.9/icons.

Here's the relevant area of httpd-autoindex.conf you need to change:

#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>

By default, WampServer should already have enabled the fancy directory listing in httpd.conf. If they are commented out, enable them:

LoadModule autoindex_module modules/mod_autoindex.so

Include conf/extra/httpd-autoindex.conf

Don't forget to reboot Apache after making these changes.




回答2:


I see you are running Apache.
Make sure your config file has an alias to icons as such:

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



回答3:


I had a directory icons/ in my root directory, and could not load anything from icons/. It shows the server icons in place of anything was there.

In C:/xampp/apache/conf/extra directory, there is httpd-autoindex.conf, this has an Alias.

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

...and this is the problem.

I had to change it to something else

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

and I changed all the references from the same file (httpd-autoindex.conf) to reflect the new Alias iconsZ/



来源:https://stackoverflow.com/questions/28131555/wamp-is-not-displaying-the-icons-in-the-directory-listing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!