去发现生活中的美好,记录生活中的点点滴滴

Linux 安装composer

composer admin 1048℃

1、下载composer.phar

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

或者

php -r "readfile('http://install.phpcomposer.com/installer');" | php

2、全局调用

1 mv composer.phar /usr/local/bin/composer
2 chmod +x composer

3、测试安装结果

composer about

4、在项目下安装依赖:

composer install
或
composer install -vvv

国内镜像:

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

5、如果提示需要token

Using GitHub token authentication

则需要到https://github.com/settings/tokens创建一个token,复制过来贴入即可;

6、自动加载:

composer dump-autoload

转载请注明:永盟博客 » Linux 安装composer

喜欢 (2)