使用 brew 安装稳定版的 composer 版本是 1.2.0 的,可是一运行 composer 就提示:
PHP Fatal error: Uncaught PharException: phar "/Users/wwx/Developer/Cellar/composer/1.2.0/libexec/composer.phar" SHA1 signature could not be verified: broken signature in /Users/wwx/Developer/Cellar/composer/1.2.0/libexec/composer.phar:23 Stack trace: #0 /Users/wwx/Developer/Cellar/composer/1.2.0/libexec/composer.phar(23): Phar::mapPhar('composer.phar') #1 {main} thrown in /Users/wwx/Developer/Cellar/composer/1.2.0/libexec/composer.phar on line 23 Fatal error: Uncaught PharException: phar "/Users/wwx/Developer/Cellar/composer/1.2.0/libexec/composer.phar" SHA1 signature could not be verified: broken signature in /Users/wwx/Developer/Cellar/composer/1.2.0/libexec/composer.phar on line 23 PharException: phar "/Users/wwx/Developer/Cellar/composer/1.2.0/libexec/composer.phar" SHA1 signature could not be verified: broken signature in /Users/wwx/Developer/Cellar/composer/1.2.0/libexec/composer.phar on line 23 Call Stack: 0.0063 359032 1. {main}() /Users/wwx/Developer/Cellar/composer/1.2.0/libexec/composer.phar:0 0.0064 359032 2. Phar::mapPhar() /Users/wwx/Developer/Cellar/composer/1.2.0/libexec/composer.phar:23
就想直接安装 master 版看看,搜了一下 homebrew 还真有真有这个参数,安装后 composer 就又可以正常运行了。
brew install composer --HEAD