图片没有加载到我的服务器,这是我遇到的错误
Forbidden You don't have permission to access PATH/abc.png on this server
我可以访问图像文件夹并列出所有图像,但无法使用 url 访问它。 Permission 没有问题我已经尝试了所有权限级别,包括 777。
经过研究,我发现问题可能与 apache 配置文件有关。这是 httpd.conf 的一部分
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
并且没有为图像设置别名。提前致谢。
最佳答案
好吧,你的 httpd.conf 似乎没问题,你也尝试通过授予权限 777 来访问文件。但你仍然无法访问你的文件。
这意味着其他东西正在拒绝访问。这种行为类似于 SELinux 访问控制。
所以,relabeling files使用 chcon 将解决此权限问题。
chcon -Rht httpd_sys_content_t /path/to/images/directory
CentOS wiki 对SELinux Access Control 有很好的解释。
关于php - 图像文件未在 Apache Linux Fedora 17 中加载。403 禁止错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28145861/