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
相关推荐
@syh.16 分钟前
【linux】进程信号
linux
funnycoffee12333 分钟前
Linux查看版本号命令cat /etc/os-release
linux·服务器
xiaoliuliu123452 小时前
Kylin V10 安装 compat-gcc-44-4.4.7-8.el7.x86_64.rpm 详细步骤
linux·运维·服务器
蓝黑20202 小时前
Ubuntu Linux安装搜狗拼音输入法
linux·ubuntu·输入法·pinyin
峰顶听歌的鲸鱼2 小时前
Kubernetes-Pod
linux·运维·云原生·容器·kubernetes·云计算
敲代码的哈吉蜂2 小时前
haproxy——socat热更新工具
linux·运维·服务器
IvanCodes2 小时前
十、Linux Shell脚本:流程控制语句
linux·云计算
小庄梦蝶3 小时前
宝塔使用nodejs管理器下载nodejs版本失败解决方式之一
linux·运维·前端
8125035333 小时前
DNS监控:生产实践
linux·网络·网络协议·tcp/ip·计算机网络
Unpredictable2223 小时前
Ubuntu 22.04 ROS2 Humble 源码编译安装 teb_local_planner 踩坑记录
linux·ubuntu·teb·自主导航·局部路径规划