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
相关推荐
2301_819287121 小时前
ce第六次作业
linux·运维·服务器·网络
武汉联从信息2 小时前
如何使用linux日志管理工具来管理oracle osb服务器日志文件?
linux·运维·服务器
Aileen_0v02 小时前
【AI驱动的数据结构:包装类的艺术与科学】
linux·数据结构·人工智能·笔记·网络协议·tcp/ip·whisper
州周3 小时前
Ftp目录整个下载
linux·服务器·数据库
Jackey_Song_Odd3 小时前
Ubuntu 24.04.1 解决部分中文字符(门、径)显示错误的问题
linux·ubuntu
kaixin_learn_qt_ing3 小时前
Linux export命令
linux
余额不足121383 小时前
C语言基础十六:枚举、c语言中文件的读写操作
linux·c语言·算法
冷曦_sole3 小时前
linux-19 根文件系统(一)
linux·运维·服务器
AI大模型学徒3 小时前
Linux(二)_清理空间
linux·运维·服务器
云川之下3 小时前
【linux】 unshare -user -r /bin/bash命令详解
linux·bash·unshare