linux安装composer

linux安装composer

https://www.runoob.com/w3cnote/composer-install-and-usage.html
Linux 平台可以使用以下命令来安装:

1、下载配置文件并安装

前提条件,已经安装了php73he mysql8

php73 -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');"
php73 composer-setup.php

All settings correct for using Composer
Downloading...

Composer (version 1.9.0) successfully installed to: /usr/share/nginx/composer.phar
Use it: php composer.phar

移动 composer.phar,这样 composer 就可以进行全局调用:

2、调整php73为 php,

cd usr/bin
cp php73 php

/*
这一步很重要,否则会报错
/usr/bin/env: php: 没有那个文件或目录
*/

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

切换为国内镜像:

3、安装composer

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

更新 composer:

composer selfupdate
posted @ 2019-10-01 18:32  心目  阅读(602)  评论(0编辑  收藏  举报