Install PHP Composer on CentOS 7 failed

10,049

Solution 1

wget https://getcomposer.org/composer.phar
chmod +x composer.phar
mv composer.phar /usr/local/bin/composer

Solution 2

What don't you use yum instead of manual installation? Use follow command:

yum install php71w-composer

you can replace php71w with other version as you like, such as php55w is php 5.5, php56w is php 5.6, php70w is php 7.0 and so on.If you meet the error message like "package php71w-composer not found", install webtatic repository follow by this.

Solution 3

Already tried with composer's documentation?

This method?

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');"

Or just tried with the download page:

Share:
10,049
Marlon van Leeuwaarde
Author by

Marlon van Leeuwaarde

Updated on June 14, 2022

Comments