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
相关推荐
AMoon丶4 分钟前
C++模版-函数模版,类模版基础
java·linux·c语言·开发语言·jvm·c++·算法
ryan007liu32 分钟前
shell 批量执行locust 脚本压测
linux·服务器·压力测试
AMoon丶1 小时前
Golang--多种数据结构详解
linux·c语言·开发语言·数据结构·c++·后端·golang
高旭的旭2 小时前
Ubuntu 无显示器远程桌面完美方案
linux·ubuntu·计算机外设
峥嵘life2 小时前
Android16 【CTS】CtsWindowManagerDeviceAnimations存在fail项
android·linux·学习
VermouthSp2 小时前
上下文切换
linux·rust
我爱学习好爱好爱3 小时前
Logstash 数据管道测试案例:从 Filebeat 接收日志并输出至黑屏幕与 Elasticsearch(基于Rocky Linux 9.6)
大数据·linux·elasticsearch
桌面运维家3 小时前
Windows VHD虚拟磁盘技术详解与应用指南
linux·运维·服务器
hy____1234 小时前
Linux_网络基础2
linux·服务器·网络
微露清风4 小时前
系统性学习Linux-第六讲-Ext文件系统
linux·服务器·学习