.composer/config文件权限使用laravel拒绝 [英] .composer/config file permission denied using laravel
问题描述
我在ubuntu virtualbox上有一个laravel项目.
我曾经运行composer update
,并且一切正常.我不知道有什么变化可能会影响到这一点,但是现在当我运行composer update
时,我得到了
I have a laravel project on an ubuntu virtualbox.
I used to run composer update
and all worked fine. I don't know of any changes that could have affected this but now when I run composer update
I get
file_get_contents(/home/user/.composer/config.json): failed to open stream:
Permission denied
file_get_contents(/home/user/.composer/config.json): failed to open stream:
Permission denied
有人知道为什么吗?当我运行sudo composer update
时,它可以工作.
Does anyone know why? When I run sudo composer update
, it works.
推荐答案
您的权限有所更改(可能与运行composer
不相关).将该文件的所有者设置为您的用户应该可以解决此问题:
Your permissions got changed somehow (perhaps not related with running composer
). Setting the owner of that file as your user should fix the issue:
sudo chown user /home/user/.composer/config.json
以上假设用户名是主目录中的user
.附带说明一下,当使用sudo
以超级用户身份运行它时,它可以工作,因为在这种情况下没有权限限制.
The above assumes that the username is user
from the home path. As a side note, it works when running it as a super user using sudo
because there's no permissions restrictions in that case.
这篇关于.composer/config文件权限使用laravel拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!