php7安装composer

时间:2024-03-11 08:37:44

下面介绍的是php7安装composer

/root目录下载composer.phar

[root@VM-0-15-centos ~]# curl -sS https://getcomposer.org/installer | php

#把composer.phar转移之bin目录以便全局使用
[root@VM-0-15-centos ~]# mv composer.phar /usr/local/bin/composer
#展示版本信息说明成功
[root@VM-0-15-centos ~]# composer -v

如果出现这个提示,是因为composer不建议root账号运行,可以输入y,或者切换账号

Do not run Composer as root/super user! See https://getcomposer.org/root for details
Continue as root/super user [yes]?