Press "Enter" to skip to content

Centos7安装Composer

1.使用命令下载:

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

2.设置环境变量:

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

3.设置权限:

chmod -R 777 /usr/local/bin/composer

补充:如果执行curl报错:-bash: php: command not found、执行composer报错:/usr/bin/env: php: No such file or directory,可以建立软链:

ln -s /usr/local/php/bin/php /usr/local/bin/php

4. 由于众所周知的原因,国外的网站连接速度很慢。因此安装的时间可能会比较长,我们建议使用国内镜像(阿里云):

composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/

Comments are closed, but trackbacks and pingbacks are open.