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
相关推荐
a_安徒生15 分钟前
linux安装TDengine
linux·数据库·tdengine
追风赶月、21 分钟前
【Linux】线程概念与线程控制
linux·运维·服务器
小字节,大梦想23 分钟前
【Linux】重定向,dup
linux
blessing。。1 小时前
I2C学习
linux·单片机·嵌入式硬件·嵌入式
2202_754421542 小时前
生成MPSOC以及ZYNQ的启动文件BOOT.BIN的小软件
java·linux·开发语言
运维&陈同学2 小时前
【zookeeper03】消息队列与微服务之zookeeper集群部署
linux·微服务·zookeeper·云原生·消息队列·云计算·java-zookeeper
周末不下雨3 小时前
win11+ubuntu22.04双系统 | 联想 24 y7000p | ubuntu 22.04 | 把ubuntu系统装到1T的移动固态硬盘上!!!
linux·运维·ubuntu
哎呦喂-ll4 小时前
Linux进阶:环境变量
linux
Rverdoser4 小时前
Linux环境开启MongoDB的安全认证
linux·安全·mongodb