duanao6704 2017-06-02 07:56
浏览 379
已采纳

在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 2017-06-02 08:05
    关注
    wget https://getcomposer.org/composer.phar
    chmod +x composer.phar
    mv composer.phar /usr/local/bin/composer
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
  • dpfw3607 2017-06-02 07:59
    关注

    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:

    评论
  • dongzi3805 2017-06-02 08:14
    关注

    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.

    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 欧姆龙PLC 电机控制 限位
  • ¥30 如何处理shell命令接收到的视频流并实时播放出来
  • ¥15 虚心请教C#的代码优化问题
  • ¥15 有偿求做台风过境全过程模拟仿真
  • ¥50 求!AutomationDesk 如何自动导入Variant数据
  • ¥20 Next.JS 静态导出路由
  • ¥15 我做一个对中文文本情感分析的项目 我用了CNN,和keras框架 报的错误我一直处理不好
  • ¥15 unity使用bakery打光烘焙所遇到的问题。
  • ¥99 二维有限元方法求解,泊松方程
  • ¥35 我需要在PC端 开两个抖店工作台客户端.(语言-java)