Go to the folder located in php.exe.
C:\wamp\bin\php\php5.5.12\
open cmd and run the command below.
php -r "readfile('https://getcomposer.org/installer');" | php
composer.phar will be loaded into the same folder.
Create a folder called composer in the C:// driver (or anywhere, for the upcoming steps, remember the path).
move the composer.phar file to the C://composer folder.
Create the composer.bat file in the same folder with the contents below
@ECHO OFF php "%~dp0composer.phar" %*
create a file called composer without any extensions.
type NUL > composer command in CMD will help to do this quickly,
Open this file and place it inside the content.
#!/bin/sh dir=$(d=$(dirname "$0"); cd "$d" && pwd)
Save.
Now set path , so we can access the composer from cmd.
Show desktop.
Right-click the My Computer shortcut on the desktop.
Click "Properties."
You should see the control panel section - Control Panel \ System and Security \ System.
Click "Advanced System Settings" on the left menu.
Click "Environment Variables" at the bottom of the window.
Select PATH from the list of user variables.
Add your PHP path (C: \ composer) to the PATH variable, separated from the existing colon string.
Click OK
Reboot the computer.
Or restart explorer only using the command below in CMD.
taskkill /f /IM explorer.exe start explorer.exe exit
Original article with screenshots here: http://aslamise.blogspot.com/2015/07/installing-composer-manually-in-windows-7-using-cmd.html
Muhammed Aslam C Jul 25 '15 at 9:41 2015-07-25 09:41
source share