ErrorException failed to open stream: Permission denied on composer install

Viewed 4411

I had a laravel app on github and I want to clone on other computer . After I cloned the repository and run composer install command it shows me this error:

[ErrorException]                                                              
  copy(/Users/cosminciolacu/.composer/cache/files/symfony/debug/824e1c185cf2cd  
  10402999589458f4be7ef980e1.zip): failed to open stream: Permission denied 

what I missed?

2 Answers

You may need to change the ownership and permissions of the directory you have installed the project in.

cd /path/to/project
sudo chmod -R 775 .
sudo chmod 660 .env

If the first answer did not work, do sudo composer install instead of composer install.

Warning: well, said in comment section.

Related