centos7安装composer
admin
2023-03-04 16:42:18
0

1.下载composer.phar
// 如果是网络原因失败,多试几次
curl -sS https://getcomposer.org/installer | php

2.把composer.phar移动到环境下让其变成可执行

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

3.测试
composer -v

Do not run Composer as root/super user! See https://getcomposer.org/root for details


/ __/_ __ _ ____
/ / /
\/ ` \/ \/ \/
/ _ \/ /
/ /
/ // / / / / / / // / // ( ) / /
__/__/
/ // // ./__/__/\//
/
/
Composer version 1.9.0 2019-08-02 20:55:32

Usage:
command [options] [arguments]

Options:
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable ANSI output
-n, --no-interaction Do not ask any interactive question
--profile Display timing and memory usage information
--no-plugins Whether to disable plugins.
-d, --working-dir=WORKING-DIR If specified, use the given directory as working directory.
--no-cache Prevent use of the cache
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
about Shows the short information about Composer.
archive Creates an archive of this composer package.
browse Opens the package's repository URL or homepage in your browser.
check-platform-reqs Check that platform requirements are satisfied.
clear-cache Clears composer's internal package cache.
clearcache Clears composer's internal package cache.
config Sets config options.
create-project Creates new project from a package into given directory.
depends Shows which packages cause the given package to be installed.
diagnose Diagnoses the system to identify common errors.
dump-autoload Dumps the autoloader.
dumpautoload Dumps the autoloader.
exec Executes a vendored binary/script.
global Allows running commands in the global composer dir ($COMPOSER_HOME).
help Displays help for a command
home Opens the package's repository URL or homepage in your browser.
i Installs the project dependencies from the composer.lock file if present, or falls back on the composer.json.
info Shows information about packages.
init Creates a basic composer.json file in current directory.
install Installs the project dependencies from the composer.lock file if present, or falls back on the composer.json.
licenses Shows information about licenses of dependencies.
list Lists commands
outdated Shows a list of installed packages that have updates available, including their latest version.
prohibits Shows which packages prevent the given package from being installed.
remove Removes a package from the require or require-dev.
require Adds required packages to your composer.json and installs them.
run Runs the scripts defined in composer.json.
run-script Runs the scripts defined in composer.json.
search Searches for packages.
self-update Updates composer.phar to the latest version.
selfupdate Updates composer.phar to the latest version.
show Shows information about packages.
status Shows a list of locally modified packages, for packages installed from source.
suggests Shows package suggestions.
thanks Give thanks (in the form of a GitHub ★ ) to your fellow PHP package maintainers.
u Upgrades your dependencies to the latest version according to composer.json, and updates the composer.lock file.
update Upgrades your dependencies to the latest version according to composer.json, and updates the composer.lock file.
upgrade Upgrades your dependencies to the latest version according to composer.json, and updates the composer.lock file.
validate Validates a composer.json and composer.lock.
why Shows which packages cause the given package to be installed.
why-not Shows which packages prevent the given package from being installed.

4.镜像地址
5.composer config -g repo.packagist composer https://packagist.phpcomposer.com

相关内容

热门资讯

红场阅兵在即:首次取消展示重型... 澎湃新闻记者 薛晶俄罗斯将于5月9日在莫斯科举行卫国战争胜利日阅兵活动。据新华社报道,5月7日,俄罗...
吉林化工园区推动产业转型升级抢... 进入生产旺季,吉林化工园区美思德(吉林)新材料有限公司生产线满负荷运转。在数字化车间内,巨大的信息屏...
我国首台双核原子量子计算机“汉... IT之家 5 月 8 日消息,据央视新闻今日消息,由中国科学院牵头,联合武汉大学、华中科技大学和武汉...
台军前高官怒轰M1A2T战车“... 海峡导报综合报道 民进党当局对美采购108辆M1A2T战车,但台陆军前司令李翔宙怒轰,采购M1A2T...
爆火的“平替游”,正在撕开谁的... 【文/观察者网 邓军 编辑/赵乾坤】受中东地缘局势不确定性及国际油价波动等因素影响,今年“五一”假期...
8名网贷设计者,揭秘大厂如何“... 00后李明,是老同学眼中“别人家的孩子”。他在重点大学读着自己梦想的心理学专业,还计划念博士。每次和...
“横行霸道”2亿年,小小螃蟹如... 一项近日发表于eLife的研究汇总形成了迄今最大的关于螃蟹如何运动的数据集。通过对比多个物种,科学家...
移动云 智能新空间 2026移... 做强算力资源、搭建服务平台、焕新AI体验、推进生态共建……5月8日,中国移动2026移动云大会主论坛...
4月岛内县市长声量排行蒋万安居... 海峡导报综合报道 随着2026“九合一”选战逼近,选举相关讨论声量逐步升高。岛内媒体调查4月份全台县...
马斯克官宣:解散xAI! 最新官宣。 当地时间5月6日,埃隆・马斯克在社交平台X正式宣布,xAI将解散并停止作为独立公司运营,...