thinkphp linux,ThinkPHP V5 Linux Composer 安装与使用

Composer 是 PHP 的一个依赖管理工具。我们可以在项目中声明所依赖的外部工具库,Composer 会帮你安装这些依赖的库文件,有了它,我们就可以很轻松的使用一个命令将其他人的优秀代码引用到我们的项目中来。

Composer 的安装

全局安装

你可以将此文件放在任何地方。如果你把它放在系统的 PATH 目录中,你就能在全局访问它。 在类Unix系统中,你甚至可以在使用时不加 php 前缀。

你可以执行这些命令让 composer 在你的系统中进行全局调用:

移动 composer.phar,这样 composer 就可以进行全局调用:curl -sS https://getcomposer.org/installer | php

mv composer.phar /usr/local/bin/composer

切换为国内镜像:composer config -g repo.packagist composer https://packagist.phpcomposer.com

更新composer: composer selfupdate

如果你进行了全局安装,并且没有 phar 文件在当前目录,请使用下面的命令代替:composer installapplication build.php CHANGELOG.md composer.json extend index.html LICENSE.txt public README.md runtime think vendor

[root@AY1310080849526341abZ mhlife-api]# curl -sS https://getcomposer.org/installer | php -- --install-dir=bin

The defined install dir (bin) does not exist.

[root@AY1310080849526341abZ mhlife-api]# curl -sS https://getcomposer.org/installer | php

All settings correct for using Composer

Downloading...

Composer (version 1.8.6) successfully installed to: /mnt/www/mhlife/blog/mhlife-api/composer.phar

Use it: php composer.phar

[root@AY1310080849526341abZ mhlife-api]# mv composer.phar /usr/local/bin/composer

[root@AY1310080849526341abZ mhlife-api]# ls

application CHANGELOG.md extend LICENSE.txt README.md think

build.php composer.json index.html public runtime vendor

[root@AY1310080849526341abZ mhlife-api]# composer config -g repo.packagist composer https://packagist.phpcomposer.com

[root@AY1310080849526341abZ mhlife-api]# composer selfupdate

You are already using composer version 1.8.6 (stable channel).

[root@AY1310080849526341abZ mhlife-api]# composer install

Loading composer repositories with package information

Updating dependencies (including require-dev)

Package operations: 2 installs, 0 updates, 0 removals

- Installing topthink/think-installer (v1.0.12): Downloading (100%)

The Process class relies on proc_open, which is not available on your PHP installation.

The archive may contain identical file names with different capitalization (which fails on case insensitive filesystems)

Unzip with unzip command failed, falling back to ZipArchive class

- Installing topthink/framework (v5.0.24): Downloading (100%)

The Process class relies on proc_open, which is not available on your PHP installation.

The archive may contain identical file names with different capitalization (which fails on case insensitive filesystems)

Unzip with unzip command failed, falling back to ZipArchive class

Writing lock file

Generating autoload files

[root@AY1310080849526341abZ mhlife-api]# ls

application CHANGELOG.md composer.lock index.html public runtime thinkphp

build.php composer.json extend LICENSE.txt README.md think vendor

[root@AY1310080849526341abZ mhlife-api]#

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值