记载一次 composer 错误 composer failed to open stream: Permission denied

今天在部署项目的时候遇到问题:

Cannot create cache directory /home/ubuntu/.composer/cache/repo/https—packagist.phpcomposer.com/, or directory is not writable. Proceeding without cache

Loading composer repositories with package information

Installing dependencies (including require-dev) from lock file

Package operations: 75 installs, 0 updates, 0 removals

- Installing symfony/thanks (v1.0.7): Downloading (100%)

[ErrorException] copy(/home/ubuntu/.composer/cache/files/symfony/thanks/818a15707b5546379c82e99d8f6831f903fd4833.zip): failed to open stream: Permission denied

install [–prefer-source] [–prefer-dist] [–dry-run] [–dev] [–no-dev] [–no-custom-installers] [–no-autoloader] [–no-scripts] [–no-progress] [–no-suggest] [-v|vv|vvv|–verbose] [-o|–optimize-autoloader] [-a|–classmap-authoritative] [–apcu-autoloader] [–ignore-platform-reqs] [–] []…

解决办法:

sudo chown -R $USER ~/.composer/

你可能感兴趣的:(记载一次 composer 错误 composer failed to open stream: Permission denied)