Install PHP Composer on CentOS 7 failed
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:
Marlon van Leeuwaarde
Updated on June 14, 2022Comments
-
Marlon van Leeuwaarde almost 2 years
I'm trying to install Magento 2.1 using PHP composer.
http://idroot.net/tutorials/how-to-install-php-composer-on-centos-7/
I found the url above to install PHP composer for Centos 7.
on step 2 it failed:
curl -sS https://getcomposer.org/installer | php
this is the error I get
"curl: (6) Could not resolve host: php; Name or service not known
Thanks for the help guys!
-
lovecoding over 3 yearsWorked well! Pefect!