## **windows下安装composer方法**
1.假定php安装目录为C:\phpStudy\PHPTutorial\php\php-7.2.1-nts
![](https://box.kancloud.cn/2d3d1857dc8c288450d9d2f114e9f2e4_1122x774.jpg)
2.将php安装目录加入PATH环境变量(右击此电脑->属性->高级系统设置->环境变量->Path->编辑->新建)
![](https://box.kancloud.cn/839d4aa8cf0d8a81ec6b0c703e6284d8_1534x823.jpg)
3.查看php环境变量是否配置成功(cmd->php -v)
![](https://box.kancloud.cn/35e29f070d9a0cca54fdf9191c3f1ebc_978x194.png)
4.下载Composer [Composer-Setup.exe](https://getcomposer.org/Composer-Setup.exe)
下载完成composer下一步即可
5.查看compser是否安装成功(cmd->composer)
![](https://box.kancloud.cn/e1aedd590c373c652e365393853c55b8_976x315.png)
6.[安装composer中国镜像](https://pkg.phpcomposer.com/)
```
composer config -g repo.packagist composer https://packagist.phpcomposer.com
```