Laravel 5.0许可在Ubuntu [英] Laravel 5.0 Permission on ubuntu

查看:116
本文介绍了Laravel 5.0许可在Ubuntu的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每当我从混帐拉我的生产服务器,这是蔚蓝的VPS上,我不得不放弃允许我p​​roejct目录,这样apache用户可以访问它。否则,它说,权限被拒绝例外。
所以我必须在每一个终端每当我拉新的code时运行以下行,

 须藤CHOWN -R WWW的数据:WWW的数据projectDirectory

和最糟糕的是,每当Laravel创建日志的新文件,同样的问题发生了,这给了我以下异常:


  

的Symfony \\分量\\调试\\异常\\ FatalErrorException:异常
  '的Symfony \\分量\\调试\\异常\\ FatalErrorException'与消息
  未捕获的异常'UnexpectedValueException有消息的
  流或文件/storage/logs/laravel-2016-03-17.log


谁能告诉我,我怎么能摆脱这一关键问题。谢谢


  

P.S。我知道这是无关与laravel。



解决方案

所以,我atlast找到一个解决方案。我真正想要的是,每当创建新的文件应该从父目录继承所有权限。

须藤搭配chmod G + S / projectDirectory

Whenever i pull from git on my production server, which is azure vps, i have to give permission to my proejct directory, so that apache user can access it. Otherwise it says, permission denied exception. so i have to run following line in terminal every time whenever i pull new code,

sudo chown -R www-data:www-data projectDirectory 

And the worst thing is whenever Laravel creates new files for log, same issue happens, which gives me following exception:

Symfony\Component\Debug\Exception\FatalErrorException: Exception 'Symfony\Component\Debug\Exception\FatalErrorException' with message 'Uncaught exception 'UnexpectedValueException' with message 'The stream or file " /storage/logs/laravel-2016-03-17.log

Can anyone tell me how i can get rid of this critical issue. Thanks

P.S. I know this is has nothing to do with laravel.

解决方案

So, atlast i found a solution. What i really wanted was, whenever new file is created it should inherit all permissions from parent directory.

sudo chmod g+s /projectDirectory

这篇关于Laravel 5.0许可在Ubuntu的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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