无法访问特定文件夹中的文件
我在 Windows 7 机器上运行 WampServer2,但似乎无法访问特定文件夹中的资源。更具体地说,当我尝试访问以下位置的文件时:
[application path]/app/plugins/my_plugin/assets/image.png
它给了我一个 403 - Forbidden 错误。
这似乎是特定文件夹的问题,因为如果我尝试从
[application path]/assets/image.png
正常运行的所有内容
中加载资产,这是我从 Apache 错误日志中得到的信息:
[Fri Jan 13 22:29:13 2012] [error] [client 127.0.0.1] client denied by server
configuration: C:/my_vhosts/infector.eu/app/plugins/demo_plugin/assets/styles.css,
referer: http://local.infector.eu/demo_plugin
这是我在 httpd-vhosts.conf 中的虚拟主机设置,
NameVirtualHost *:80
<VirtualHost *:80>
ServerName local.infector.eu
DocumentRoot "C:/my_vhosts/infector.eu"
<Directory "C:/my_vhosts/infector.eu">
AllowOverride All
Allow from All
</Directory>
</VirtualHost>
我似乎看不到弄清楚这个文件夹有什么不同,这让我很烦恼...同一个应用程序在我工作中使用的 IIS PHP 安装的电脑上运行良好。
关于如何修复权限有什么想法吗?
[编辑]
经过一些检查,我意识到应用程序文件夹是只读的...我不知道只读文件夹如何导致apache无法加载资源,但在我取消选中之后只读框我不再收到 403!
I'm running WampServer2 on a Windows 7 box, and I can't seem to access assets from a specific folder. To be more specific, when I try to access the file in:
[application path]/app/plugins/my_plugin/assets/image.png
it gives me a 403 - Forbidden error.
This seems to be an issue for the specific folder, because if I try to load assets from
[application path]/assets/image.png
everything works normally
Here is what I get from the Apache error log:
[Fri Jan 13 22:29:13 2012] [error] [client 127.0.0.1] client denied by server
configuration: C:/my_vhosts/infector.eu/app/plugins/demo_plugin/assets/styles.css,
referer: http://local.infector.eu/demo_plugin
Here is my virtual host settings in httpd-vhosts.conf
NameVirtualHost *:80
<VirtualHost *:80>
ServerName local.infector.eu
DocumentRoot "C:/my_vhosts/infector.eu"
<Directory "C:/my_vhosts/infector.eu">
AllowOverride All
Allow from All
</Directory>
</VirtualHost>
I can't seem to figure out what's different about this folder, and it bugs me... The same application works fine in the pc I use at work which is an IIS PHP installation.
Any ideas about how to fix the permissions?
[EDIT]
After some checks I realised that the app folder was Read Only... I have no idea how a read-only folder causes apache to be unable to load resources but after I unchecked the read-only box I get 403 no more!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
检查文件夹权限? IIS 安装可能不像 Apache 那样尊重文件夹权限。
Check folder permissions? It could be that the IIS installation doesn't respect folder permissions the same way Apache does.