Centos 安装 Composer

如果你服务器上没有安装 Composer,执行相关命令会提示:

-bash: composer: command not found

如何解决?如下命令安装:

# cd /tmp


下载 composer.phar 文件:

# curl -sS https://getcomposer.org/installer | php

All settings correct for using Composer
Downloading 1.2.1…

Composer successfully installed to: /tmp/composer.phar
Use it: php composer.phar


把 composer.phar 文件移到 /usr/local/bin 目录下(并重命名为 composer):

# mv composer.phar /usr/local/bin/composer

 

安装完成,可以使用 composer 命令了!

 

相关文章