duanao6704
duanao6704
2017-06-02 07:56

在CentOS 7上安装PHP Composer失败

已采纳

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!

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

3条回答

  • doulong1987 doulong1987 4年前
    wget https://getcomposer.org/composer.phar
    chmod +x composer.phar
    mv composer.phar /usr/local/bin/composer
    
    点赞 评论 复制链接分享
  • dongzi3805 dongzi3805 4年前

    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.

    点赞 评论 复制链接分享
  • dpfw3607 dpfw3607 4年前

    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:

    点赞 评论 复制链接分享