How to run composer from anywhere?

前端 未结 10 1516
名媛妹妹
名媛妹妹 2020-12-04 07:51

I have just installed composer in my /usr/bin folder, so when from that folder I run php composer.phar I get the help info about composer. But, whe

10条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-04 08:12

    You can do a simple global install to run it from anywhere

    curl -sS https://getcomposer.org/installer | php
    mv composer.phar /usr/local/bin/composer
    

    The https://getcomposer.org/doc/00-intro.md#globally website recommends this way. Worked well on Ubuntu 14.04 no problem. This way you don't need to do as an example php compomser.phar show , you just do composer show , in any directory you are working with.

提交回复
热议问题