自学内容网 自学内容网

composer安装

前提:服务器得有php的运行环境,环境变量,

vim /etc/profile

查看

export PATH= P A T H : PATH: PATH:NETCAT_HOME/bin:/opt/lee

增加

export PATH= P A T H : PATH: PATH:NETCAT_HOME/bin:/opt/lee:/opt/lampp/bin

刷新文件

source /etc/profile

验证

[root@mycrm ~]# php -v
PHP 5.6.40 (cli) (built: Feb 11 2019 09:53:16)
Copyright © 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright © 1998-2016 Zend Technologies

安装

1.Composer下载(yum install wget)
wget https://getcomposer.org/download/2.2.23/composer.phar
2. 授权
chmod a+x composer.phar
3. 移动 composer.phar 为任意目录可执行
mv composer.phar /usr/local/bin/composer
4. 测试 composer
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Continue as root/super user [yes]?
出于安全考虑,composer不建议以root用户执行命令,但是也可以忽略继续执行。

[root@target bin]# composer --version
Do not run Composer as root/super user! See https://getcomposer.org/root for details
Continue as root/super user [yes]? yes
Composer version 2.2.23 2024-02-08 15:08:53
  1. 配置 composer 源为国内源
    composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/

原文地址:https://blog.csdn.net/zhuge_long/article/details/143787348

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!