composer / composer

Dependency Manager for PHP
https://getcomposer.org/
MIT License
28.58k stars 4.55k forks source link

Error when using composer #3470

Closed brasileric closed 9 years ago

brasileric commented 9 years ago

Hi, It looks so simple, so installed Composer without problems, but now when I want to install Omnipay by Composer I get this error:

$ php composer.phar install Loading composer repositories with package information file_put_contents(/home/hericadmin/.composer/cache/repo/https---packagist.org/packages.json): failed to open stream: Permission denied https://packagist.org could not be fully loaded, package information was loaded from the local cache and may be out of date Installing dependencies (including require-dev)

[Composer\Repository\RepositorySecurityException] The contents of http://packagist.org/p/omnipay/2checkout$9483edd00d6d9c3fc7ca6c3e4cb1a6b290c4f4d37ef4f01fdb41e33a24404d29.json do not match its signature. This should indicate a man-in-the-mid dle attack. Try running composer again and report this if you think it is a mistake.

install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [--ignore-platform-reqs] [packages1] ... [packagesN]

xabbuh commented 9 years ago

Is the /home/hericadmin/.composer directory or its cache subdirectory not owned by your user?

brasileric commented 9 years ago

not owned by user, I didn't choose this directory

brasileric commented 9 years ago

well, I fixed by giving this cache folder writing rights.

mohsenuss91 commented 7 years ago

@brasileric how to do that please!

chocopowwwa commented 7 years ago

@brasileric THANK YOU!!

@mohsenuss91 see this for the cache dir: https://getcomposer.org/doc/06-config.md#cache-dir

in my case simply chown the cache dir

AleksandarSavic95 commented 6 years ago

@mohsenuss91 I used this command for the cache folder: sudo chmod -R a+rw /home/USERNAME_HERE/.composer/cache

mategvo commented 5 years ago

@AleksandarSavic95 for current user: sudo chmod -R a+rw ~/.composer/cache