Permission based issue with Valet (so it seems)

三世轮回 提交于 2019-12-11 18:01:09

问题


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

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:

and this:

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


回答1:


You need to give permission to your storage directory.

In my local mac I generally do

sudo chmod -R 777 storage/

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

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.

for nginx use:

ps aux|grep nginx|grep -v grep

for apache use:

ps aux | egrep '(apache|httpd)'


来源:https://stackoverflow.com/questions/57967577/permission-based-issue-with-valet-so-it-seems

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!