1.先下载Composer-Setup.exe

双击安装

下一步

下一步


选择后

下一步

下一步

安装

等待

下一步

完成。
2.在PHP目录下,打开php.ini文件,开启openssl扩展。去掉extension=php_openssl.dll前面的分号(;)

3.把php目录添加到环境变量(和php.exe同级目录的路径)例如:D:\apache_php\php添加到环境变量path里。

4.下载composer.phar,下载地址:Composer.phar。将composer.phar文件放入php目录下,在php目录下新建一个文件composer.cmd,内容写成:@php "%~dp0composer.phar" %*保存。运行这个文件,然后打开cmd运行:composer会出现





5.在命令行中执行:composer config -g repo.packagist composer https://packagist.phpcomposer.com
改写Packagist 镜像至国内镜像可以加快下载速度。

完成。
网友评论