这个问题似乎是在我更新到Sierra之后出现的。在检查它显示为localhost/icons/text.gif
的图像时,我创建了一个文件夹并将其分配给777
并仍然面临同样的问题。
每次查看应显示图标的页面时,apache错误日志都会被以下内容发送垃圾邮件。 /usr/share/httpd/icons/
由root拥有drwxr-xr-x
权限。
[access_compat:error] [pid 1763] [client ::1:49623] AH01797: client denied by server configuration: /usr/share/httpd/icons/unknown.gif, referer: http://localhost/testing/
[access_compat:error] [pid 1763] [client ::1:49623] AH01797: client denied by server configuration: /usr/share/httpd/icons/text.gif, referer: http://localhost/testing/
[access_compat:error] [pid 1763] [client ::1:49623] AH01797: client denied by server configuration: /usr/share/httpd/icons/folder.gif, referer: http://localhost/testing/
[access_compat:error] [pid 1763] [client ::1:49623] AH01797: client denied by server configuration: /usr/share/httpd/icons/compressed.gif, referer: http://localhost/testing/
如果使用以下命令打开Apache配置文件:
sudo nano /private/etc/apache2/httpd.conf
然后输入以下代码(您可以将其放在其他目录代码旁边):
<Directory /usr/share/httpd/icons>
Allow from all
</Directory>
使用ctrl-O
保存文件,然后使用ctrl-X
关闭文件并使用以下命令重新启动apache:
sudo apachectl restart
应该允许图标加载。