I'm having error during updating composer. It's a Laravel 4 project which I've downloaded from .... and first time I updated it, it was fine and got updated. but due some reason I deleted that replace it with a fresh copy of that project, but now when I started to update it, it gives me the following error:
[ErrorException]
copy(/home/username/.composer/cache/files/symfony/security-core/3a27d7b34ee6
2cb0fdf5ad970e7777912ef4722f.zip): failed to open stream: Permission denied
In between first and second update of this composer I did the following:
- Tried to installed Vagrant and homestead, but failed due to some internet connection problem.
- Updated Composer failed
- Uninstalled vagrant and reinstall composer.
- Reinstalled Composer
- Updated composer (success)
- Tried to install vagrant and homestead (success)
- Update composer (failed)
- uninstalled vagrant
- Reinstalled Composer
- Update Composer (failed)
The above mentioned error is getting occured again and again. I also tried 'composer clearcache' but doesn't worked. One thing which I noticed that it's been 16-19 months I'm using composer and never heard of such errors, but since I tried to install vagrant it created hurdles and errors for me.
- I'm using Ubuntu 15.04
- Updating Laravel 4.0 project
- Updating Laravel 5
both project got updated before installing vagrant and homestead, but not now. /var/www is under the group of 'www-data' and 'username' also the part of this group.
Any help plz!!!!!!!!!!!!!!!
I know its an old topic, but for mac users this might be useful, since commands in macOS are a little bit different from linux distros and I had a hard time figuring this out.
Done. Now you can install/update composer.
I just run sudo before an all when ok
sudo composer create-project laravel/laravel=5.3 /Users/peter/Sites/blog --prefer-dist
I found the solution. If you see the error then it would be clear that I don't had access to the:
When I explore this directory, I found that its owner is 'root' or 'sudo'.
So I deleted the '.composer' directory and then started to update in my laravel project directory, every thing was fine and perfect! No problem at all!
I had the same issue with a mac, Composer warn me about running commands with super user permissions, so I've just changed the owner of
files
directory in the repo/Users/MyUserName/.composer/cache
like so:Hope this helps.