.composer/config文件权限使用laravel拒绝 [英] .composer/config file permission denied using laravel

查看:122
本文介绍了.composer/config文件权限使用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屋!

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