linux下composer安装与简单应用-------------------------------------安装------------------------------------//下载composercurl -sS https://getcomposer.org/installer | php //将composer.phar文件移动到bin目录以便全局使用composer命令
mv composer.phar /usr/local/bin/composer //切换国内源
composer config -g repo.packagist composer https://packagist.phpcomposer.com
------------------------------------简单应用----------------------------------//安装thinkphp5
composer create-project topthink/think whatever_you_like_name --prefer-dist
//更新项目
切换到项目文件夹中(与composer.json文件同级目录) composer update
//安装拓展 (dependency manager for PHP)
例如,安装支付宝 微信集成接口
composer require riverslei/payment
执行完了就安装了,查看composer.json文件,require部分多了 "riverslei/payment": "~2.0"
安装位置一般在项目扩展文件夹,如:TP5中的vendor.-------------------------------------------------------------------------------
原文地址:https://www.cnblogs.com/yimingwang/p/9372636.html
时间: 2024-10-23 08:32:39