简体   繁体   English

Laravel 5.0对Ubuntu的许可

[英]Laravel 5.0 Permission on ubuntu

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. 每当我从生产服务器上的git中提取时,这是azure vps,我必须授予我的proejct目录权限,以便apache用户可以访问它。 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: 最糟糕的是,每当Laravel为日志创建新文件时,都会发生同样的问题,这给了我以下异常:

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 Symfony \\ Component \\ Debug \\ Exception \\ FatalErrorException:异常'Symfony \\ Component \\ Debug \\ Exception \\ FatalErrorException'与消息'Uncaught异常'UnexpectedValueException'与消息'流或文件“ / storage / logs / laravel-2016-03-17 .log

Can anyone tell me how i can get rid of this critical issue. 谁能告诉我如何摆脱这个关键问题。 Thanks 谢谢

PS I know this is has nothing to do with laravel. PS我知道这与laravel无关。

You should execute this command in Ubuntu after installation: 安装后,您应该在Ubuntu中执行以下命令:

sudo chmod -R 777 storage

This commands will set correct permissions on storage folder and everything inside it. 此命令将对存储文件夹及其中的所有内容设置正确的权限。 Without this Laravel will not work. 没有这个,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 须藤chmod g + s / projectDirectory

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM