services.json 无法打开流:Laravel 4 中的权限被拒绝 [英] services.json failed to open stream: Permission denied in Laravel 4

查看:11
本文介绍了services.json 无法打开流:Laravel 4 中的权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在玩一个可以运行的 Laravel 4 安装,并将所有内容都移到一个子文件夹中.然后我决定不这样做,我将它全部移回(全部通过命令行):

I was playing around with a working Laravel 4 installation and moved everything into a sub folder. Then I decided to not do that and I moved it all back (all via the command line):

mv * /folder

然后

cd folder
mv * ../

现在,该网站抛出以下错误:

Now, the site is throwing the following error:

file_put_contents(/var/www/quantquote/app/storage/meta/services.json): failed to open stream: Permission denied

这是完整错误的截图:

http://i.imgur.com/8deGG97.png

我已经尝试将/storage 文件夹的权限设置为 777 无济于事.

I've already tried setting permissions on the /storage folder to 777 to no avail.

推荐答案

花了一整天的时间解决这个问题,这个命令简单地解决了我的问题.

Spent a whole day for solving this and this command simply solved my problem.

如果您对 Laravel App 文件夹的权限为 777,但您仍然收到此错误,那是因为 SEliux 已阻止它.您可以使用以下命令轻松取消阻止应用程序的文件夹:

If your permissions are 777 for Laravel App folder and you still get this error, it's because SEliux has blocked it. You can easily unblock your application's folder using this command:

su -c "chcon -R -h -t httpd_sys_script_rw_t/usr/share/nginx/YOUR_LARAVEL_APP/"

就是这样!

顺便说一句,永远不要禁用 SElinux:http://stopdisablingselinux.com/

BTW never disable SElinux: http://stopdisablingselinux.com/

这篇关于services.json 无法打开流:Laravel 4 中的权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆