代客的基于权限的问题(看来) [英] Permission based issue with Valet (so it seems)

查看:54
本文介绍了代客的基于权限的问题(看来)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我让代客开始工作,可以对.test域进行ping操作等.

I got Valet to work and .test domains can be pinged etc.

但是,当我创建一个laravel new test-site时,会出现一堆基于权限的错误.我嘘"了laravel的构建,但一再被警告不要这样做.

However, when I create a laravel new test-site I get a bunch of permission-based errors. I 'sudo'd' the laravel build but I was repeatedly warned not to do this.

如果我随后在浏览器中查看该网站,这是我得到的错误:

If I then view the site on the browser this is the error I get:

和这个:

那么-我将"sites"文件夹(可以构建")放置在机器的不合适部分中的问题吗?

So - is the problem that I placed my "sites" folder (which I can "builds") in an inappropriate section of my machine?

推荐答案

您需要授予存储目录权限.

You need to give permission to your storage directory.

我通常在本地Mac上

sudo chmod -R 777 storage/

但是,这在服务器/生产环境上很糟糕.我建议您更改目录所有权.因此,将您当前的用户(以所有者身份登录)和Web服务器用户(www-data,apache等)作为组进行设置.您可以尝试以下方法:

But this is vunerable on server/production. I would suggest you should change directory ownership. so set your current user that you are logged in with as owner and the webserver user (www-data, apache, ...) as the group. You can try this:

sudo chown -R $USER:www-data storage
sudo chown -R $USER:www-data bootstrap/cache

然后设置目录权限,请尝试以下操作:

then to set directory permission try this:

chmod -R 775 storage
chmod -R 775 bootstrap/cache

Web服务器的用户和组取决于您的Web服务器和操作系统.要确定您的Web服务器用户和组是什么,请使用以下命令.

Webserver user and group depend on your webserver and your OS. to figure out what's your web server user and group use the following commands.

供nginx使用:

ps aux|grep nginx|grep -v grep

用于Apache:

ps aux | egrep '(apache|httpd)'

这篇关于代客的基于权限的问题(看来)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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