今天在部署項目的時候遇到問題:
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/