伺服器上安裝composer總是失敗,似乎是驗證失敗,不知道該怎麼解決。我是按照官方文檔操作的,過程如下:
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php
執行到這裡之後就不行了,報如下錯誤
Downloading...
Signature mismatch, could not verify the phar file integrity
Retrying...
過一會兒之後錯誤訊息變成下面這樣
Downloading...
Signature mismatch, could not verify the phar file integrity
Retrying...
The "https://getcomposer.org/download/1.4.1/composer.phar" filecdownloaded: failed to open stream: HTTP request failed!
Retrying...
Signature mismatch, could not verify the phar file integrity
The download failed repeatedly, aborting.
然後就停止了。好無奈,試了很多遍都一樣。
我直接下載執行檔(composer.phar)倒是可以執行,但是好像就不能全域安裝了,所以還是想按照文件上的方式執行成功,不知道我該如何解決!
天蓬老师2017-05-16 13:03:13
wget https://getcomposer.org/composer.phar
cp composer.phar /usr/local/bin/composer
chmod u+x /usr/local/bin/composer
composer --help
安裝的時候用root用戶,使用的時候用非root用戶