【问题标题】:Install PHP Composer on CentOS 7 failed在 CentOS 7 上安装 PHP Composer 失败
【发布时间】:2017-11-03 13:18:30
【问题描述】:
【问题讨论】:
标签:
php
centos
composer-php
magento2
centos7
【解决方案1】:
什么不用yum代替手动安装?
使用以下命令:
yum 安装 php71w-composer
你可以把php71w换成你喜欢的其他版本,比如php55w是php 5.5,php56w是php 5.6,php70w是php 7.0等等。如果遇到类似“package php71w-composer not found”的错误信息,安装 webtatic 存储库follow by this。
【解决方案2】:
wget https://getcomposer.org/composer.phar
chmod +x composer.phar
mv composer.phar /usr/local/bin/composer
【解决方案3】:
Already tried with composer's documentation?
这个方法?
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('SHA384', 'composer-setup.php') === '669656bab3166a7aff8a7506b8cb2d1c292f042046c5a994c43155c0be6190fa0355160742ab2e1c88d40d5be660b410') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"
或者只是尝试使用download page: