是什么 ? | : | a dependency manager for PHP. |
开发语言 | : | PHP |
官方主页 | : | https://getcomposer.org |
源码仓库 | : | https://github.com/composer/composer |
操作系统 | 包管理器 | 安装命令 |
---|---|---|
Windows | scoop | scoop install composer |
Windows | Chocolatey | choco install -y composer |
macOS | HomeBrew | brew install composer |
GNU/Linux | HomeBrew | brew install composer |
apt | sudo apt-get install -y composer | |
CentOS | yum | sudo yum install -y composer |
dnf | sudo dnf install -y composer | |
openSUSE | zypper | sudo zypper install -y composer |
Alpine Linux | apk | sudo apk add composer |
pacman | sudo pacman -Syyu --noconfirm | |
Gentoo Linux | Portage | sudo emerge composer |
step1、安装依赖
安装时 | PHPToolSet、cURL |
运行时 | PHPToolSet |
step2、使用curl命令下载安装脚本并执行
curl -sS https://getcomposer.org/installer | php
这个命令会下载composer.phar
文件到当前目录。.phar
是PHP Archive(PHP 压缩包)
,类似于jar
包, 它可以直接被php命令加载并执行:
php compose.phar --help