> ### 下载composer ``` curl -sS https://getcomposer.org/installer | php ``` > ### 将composer.phar文件移动到bin目录以便全局使用composer命令 ``` mv composer.phar /usr/local/bin/composer ``` > ### 重新打开 终端 即可 ``` home@home-PC:~/Desktop$ composer ______ / ____/___ ____ ___ ____ ____ ________ _____ / / / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/ / /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ / \____/\____/_/ /_/ /_/ .___/\____/____/\___/_/ /_/ Composer version 1.9.0 2019-08-02 20:55:32 ``` > ### 切换国内镜像 ``` // phpcomposer 镜像 composer config -g repo.packagist composer https://packagist.phpcomposer.com // 或 阿里镜像 composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ ```