Linux CentOS下Composer简单使用

1.下载composer-setup.php
c 复制代码
cd /usr/local/src
php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');"
2.安装composer
c 复制代码
php composer-setup.php
3.设置全局composer
c 复制代码
cp composer.phar /usr/local/bin/composer

4.设置国内镜像

c 复制代码
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/

c 复制代码
composer config -g repo.packagist composer https://packagist.phpcomposer.com
5.查看全局配置
c 复制代码
composer config -l -g
c 复制代码
输出:
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Continue as root/super user [yes]? yes
[repositories.packagist.org.type] composer
[repositories.packagist.org.url] https://packagist.phpcomposer.com
[process-timeout] 300
[use-include-path] false
[use-parent-dir] prompt
[preferred-install] dist
[audit.abandoned] default
[notify-on-install] true
[github-protocols] [https, ssh]
[gitlab-protocol] 
[vendor-dir] vendor (/root/vendor)
[bin-dir] {$vendor-dir}/bin (/root/vendor/bin)
[cache-dir] /root/.cache/composer
[data-dir] /root/.local/share/composer
[cache-files-dir] {$cache-dir}/files (/root/.cache/composer/files)
[cache-repo-dir] {$cache-dir}/repo (/root/.cache/composer/repo)
[cache-vcs-dir] {$cache-dir}/vcs (/root/.cache/composer/vcs)
[cache-ttl] 15552000
[cache-files-ttl] 15552000
[cache-files-maxsize] 300MiB (314572800)
[cache-read-only] false
[bin-compat] auto
[discard-changes] false
[autoloader-suffix] 
[sort-packages] false
[optimize-autoloader] false
[classmap-authoritative] false
[apcu-autoloader] false
[prepend-autoloader] true
[github-domains] [github.com]
[bitbucket-expose-hostname] true
[disable-tls] false
[secure-http] true
[cafile] 
[capath] 
[github-expose-hostname] true
[gitlab-domains] [gitlab.com]
[store-auths] prompt
[archive-format] tar
[archive-dir] .
[htaccess-protect] true
[use-github-api] true
[lock] true
[platform-check] php-only
[home] /root/.config/composer
相关推荐
豆是浪个1 天前
Linux(Centos 7.6)命令详解:top
linux·运维·服务器
历程里程碑1 天前
Linxu14 进程一
linux·c语言·开发语言·数据结构·c++·笔记·算法
baidu_huihui1 天前
`sudo DNF` 是 Linux 系统中以管理员权限执行 DNF 包管理命令的标准方式
linux·dnf
峥嵘life1 天前
Android 16 EDLA测试STS模块
android·大数据·linux·学习
代码AC不AC1 天前
【Linux】进程程序替换
linux·进程·程序替换
Zach_yuan1 天前
UDP网络编程:从入门到精通
linux·网络·网络协议·udp
_叶小格_1 天前
cp、scp、rsync命令详解
linux·运维·服务器·ubuntu·centos·运维开发
wheeldown1 天前
【Linux网络编程】 Linux TCP网络编程:客户端开发+守护进程实战
linux·网络·tcp/ip
永不复还1 天前
linux 使用Xcb监听键盘鼠标输入
linux·x11·xcb
mango_mangojuice1 天前
Linux学习笔记 1.19
linux·服务器·数据库·笔记·学习