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
相关推荐
Mazy.v15 分钟前
Linux图形化界面
linux·运维·数据库
Linux技术芯15 分钟前
#Linux内存管理# 在ARM32系统中,页表是如何映射的?在ARM64系统中,页表又是如何映射的?
linux
小王努力学编程25 分钟前
【Linux网络编程】UDP Echo Server的实现
linux·运维·服务器·网络·c++·学习·udp
想睡hhh25 分钟前
Leetcode12 13——罗马数字与整数之间的转换
linux·运维·服务器
阿里云云原生29 分钟前
如何使用通义灵码玩转Linux - AI编程助手提升效率
linux
Peter_chq30 分钟前
selenium快速入门
linux·开发语言·chrome·python·selenium
Dklau-c1 小时前
『Linux_网络』 第一章 网络基础概念
linux·服务器·网络
Pseudo…1 小时前
linux shell编程规范与变量(一)
linux·运维·服务器
xhzth709111 小时前
kali安装 老版本的frida
linux
Z字小熊饼干爱吃保安1 小时前
nginx介绍和几种安装方法
linux·运维·nginx·云计算