Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.composer/config file permission denied using laravel

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

Does anyone know why? When I run sudo composer update , it works.

like image 211
user3494047 Avatar asked Dec 29 '15 13:12

user3494047


1 Answers

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

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.

like image 60
Bogdan Avatar answered Nov 05 '22 08:11

Bogdan