php - centos 上安装composer失败
本文介绍了php - centos 上安装composer失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
服务器上安装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" file could not be downloaded: >failed to open stream: HTTP request failed!
Retrying...
Signature mismatch, could not verify the phar file integrity
The download failed repeatedly, aborting.
然后就停止了。好无奈,试了很多遍都一样。
我直接下载执行文件(composer.phar)倒是可以执行,但是好像就不能全局安装了,所以还是想按照文档上的方式执行成功,不知道我该如何解决!
解决方案
下载composer
wget https://getcomposer.org/composer.phar
安装
cp composer.phar /usr/local/bin/composer
chmod u+x /usr/local/bin/composer
测试
composer --help
安装的时候用root用户,使用的时候用非root用户
这篇关于php - centos 上安装composer失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文