在Linux (centos)中全局安装php工具 composer
安装非常简单,两个步骤即可。
1,登录服务器执行如下操作:
[[email protected] ~]# curl -sS https://getcomposer.org/installer | php All settings correct for using Composer Downloading 1.2.2... Composer successfully installed to: /root/composer.phar Use it: php composer.phar
2,移动命令至/usr/local/bin/或设置path都可以。
我们这里采用移动文件至/usr/local/bin/:
[[email protected] ~]# mv composer.phar /usr/local/bin/composer [[email protected] ~]# composer -V Do not run Composer as root/super user! See https://getcomposer.org/root for details Composer version 1.2.2 2016-11-03 17:43:15
也可以尝试composer.phar 改名以后将所在路径设置到/etc/profile。看个人习惯。