4中的权限被拒绝

4中的权限被拒绝

本文介绍了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

以下是完整错误的屏幕截图:

Here is a screenshot of the full error:

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/"

就是这样!

BTW从不禁用SElinux: http://stopdisablingselinux.com/

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

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

08-04 01:34