$ sudo apt-get update
$ sudo apt-get install wget
$ wget https://getcomposer.org/composer.phar
或者 $ curl -O https://getcomposer.org/composer.phar
composer.phar
为 composer
$ mv composer.phar composer
$ chmod +x composer
./composer
命令运行composer
,但这只仅限于在当前目录运行。要想全局使用,composer
,要设置把它为全局变量。找到composer
文件,把它移到/usl/local/bin
目录,这样就可以在全局使用composer
命令。
$ sudo mv composer /usr/local/bin
在终端输入$ composer
会有如下显示,表明安装成功
Composer version 1.4-dev (d8d0ee5870010253c98a7db4d27b07cd17bd6617) 2017-01-13 09:34:43