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

相关内容

热门资讯

一个人害得全县买不了榴莲,恶意... 作者:何涛 责编:任绍敏据央视报道,近日,湖南衡山县人民法院审结一起案件:当地一男子用AI伪造榴莲、...
“红霞”已加强为强台风,中央气... 今年第12号台风“红霞”已于今天晚上10时由台风级加强为强台风级,中央气象台发布今年首个台风红色预警...
携程为何被处51.79亿元重罚... 今天(25日),市场监管总局依法对携程集团有限公司滥用市场支配地位实施垄断行为作出行政处罚,罚没款合...
山西一学生在黄土崩塌中遇难:中... 据央视新闻:7月24日18时49分,山西省洪洞县好义村发生黄土崩塌,造成一户民宅被掩埋,造成5人死亡...
“日本已有半年看不到大熊猫了” 今年1月27日,双胞胎大熊猫“晓晓”和“蕾蕾”从日本返回中国。25日,日本共同社发文感慨:到本月27...
江苏:以应用带产业给力交通“智... 胥大伟 7月23日,江苏省政府举行“人工智能+交通运输”路演会。会上发布了《江苏省“人工智能+交通运...
中国AI成功救场后,OpenA... 近日,美国人工智能公司OpenAI的模型在安全测试中失控“越狱”,攻击了全球最大AI开源平台Hugg...
新华社出图|这就是“千年瓷都”... 在中国乃至世界版图上这座城市都是独一无二一捧泥一窑火一条路让这里被世界认识更令世界倾心“中国瓷”这就...
洗衣机放不掉水怎么修 当你的洗衣机不能放水时,你可能会感到很不方便。这可能是由于以下几种原因: 1. 水龙头未打开:检查...
洗衣机放不出水是什么原因   1、原因:可能是家里或者小区停水了,导致的不出水;  解决办法:应测试家里其他水龙头是否可以正常...