Html 加载资源失败:服务器响应状态为 403(禁止),包括 css 文件和 js 库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/14413260/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Failed to load resource: the server responded with a status of 403 (Forbidden) including css files and js libraries
提问by ruudy
I'm starting developing with codeigniter and I'm doing some few basically things to learn it on localhost with easyphp (I get bug with WAMP Server).
我开始使用 codeigniter 进行开发,我正在做一些基本的事情来使用 easyphp 在本地主机上学习它(我在 WAMP 服务器上遇到了错误)。
I create the folder "libraries/js/jquery-1.9.0.min.js", and "views/templates/css/style.css" and simply in header I include the files:
我创建了文件夹“libraries/js/jquery-1.9.0.min.js”和“views/templates/css/style.css”,并简单地在标题中包含了这些文件:
<link type="text/css" href="application/views/templates/css/style.css" rel="stylesheet" />
<script type="text/javascript" src="application/libraries/js/jquery-1.9.0.min.js"></script>
And the server return to me the follow errors:
服务器返回给我以下错误:
GET http://127.0.0.1:8887/CodeIgniter_2.1.3/application/libraries/js/jquery-1.9.0.min.js 403 (Forbidden)
GET http://127.0.0.1:8887/CodeIgniter_2.1.3/application/views/tamplates/css/style.css 403 (Forbidden)
I searched for info and can be a permission problem in the files, but never happened to me before... and in a remote server I can access by ftp and change the permission, but how can I do it on localhost? If thats the problem..
我搜索了信息,可能是文件中的权限问题,但以前从未发生在我身上……在远程服务器中,我可以通过 ftp 访问并更改权限,但是我如何在本地主机上执行此操作?如果那是问题..
Thanks in advance!
提前致谢!
采纳答案by ruudy
i found a solution here:
我在这里找到了解决方案:
Where do I put image files, css, js, etc. in Codeigniter?
在 Codeigniter 中,我应该将图像文件、css、js 等放在哪里?
All people put those kind of files outside the codeigniter framework, i make it and now it works.
所有的人都把这些文件放在 codeigniter 框架之外,我做了它,现在它可以工作了。
Thanks for the help.
谢谢您的帮助。
PD: Now im fighting with the helper creation :D
PD:现在我正在与助手创建作斗争:D
回答by Dyn
A little Googling would probably suffice: How to set, view, change, or remove special permissions for files and folders in Windows XP.
稍微谷歌一下可能就足够了:如何在 Windows XP 中设置、查看、更改或删除文件和文件夹的特殊权限。
回答by betrworld
If you are using macOS just right click on the folders in which your js and css files lie then click get info and tick the shared folder checkbox.
如果您使用的是 macOS,只需右键单击 js 和 css 文件所在的文件夹,然后单击获取信息并勾选共享文件夹复选框。