1、下载下载composer.phar文件
官网下载
https://getcomposer.org/download/1.8.0/composer.phar
或者命令执行
php -r "readfile('https://getcomposer.org/installer');" | php
然后将composer.phar放在某个文件夹下,比如我的就是D:\wnmp\composer下
下载后在composer文件夹内新建两个文件composer.bat和composer
在composer.bat内写入
@echo OFF
:: in case DelayedExpansion is on and a path contains !
setlocal DISABLEDELAYEDEXPANSION
php "%~dp0composer.phar" %*
在composer内写入
#!/bin/sh
dir=$(cd "${0%[/\\]*}" > /dev/null; pwd)
if [[ -d /proc/cygdrive && $(which php) == $(readlink -n /proc/cygdrive)/* ]]; then
# We are in Cgywin using Windows php, so the path must be translated
dir=$(cygpath -m "$dir");
fi
php "${dir}/composer.phar" "$@"

然后在系统环境变量Path加上
D:\wnmp\composer

查看安装成功没

网友评论