今天本地搭建项目时 需要用到第三方库,请教了人之后,了解到这里面用了composer。composer是一个包管理器,当你的项目需要依赖很多包时,管理可能变混乱,composer的出现允许你申明你项目里面所依赖的包,它会在你的项目中为你安装他们,并且在每个项目的基础上进行管理的。你只要告诉composer需要那个版本,那个包,它就会下载到该项目安装下来。
下载安装:https://getcomposer.org/download/

下载点击安装好,切换到你的项目目录,之后需要用命令:

报错ssl没打开。打开后运行:


成功。安装中先要指定安装到那个目录下面。
参考:http://blog.csdn.net/u011252402/article/details/46997413
注:php composer.phar与composer命令:



两种安装的方法--命令、exe带来的两种写法效果是一样的,不过使用php composer.phar的话先要配好php的全局环境,再要指定好composer.phar的路径;
安装composer.phar: d:\wamp\Apache24\htdocs\yii2>php -r "readfile('https://getcomposer.org/installer');" | php
2017-3-15:
1.

这是需要先执行composer config secure-http false或者全局composer config -g secure-http false再安装,默认禁用https请求
2.安装es时,切换到该目录php composer.phar require elasticsearch/elasticsearch,会在目录生成composer.json,再会自动下载安装;
也可以先配置好composer.json内容为{"require": {"elasticsearch/elasticsearch": "~5.0"}}再用下面命令安装:

网友评论