17
I went through a fresh install of WampServer 2.4 (32 bit on a Win 7 box.) After enabling the openssl extension in php.ini, Composer installed without a hitch.
If I understand your issue correctly, composer can't find the php executable.
If you bring up a command line and enter 'path' as the command, you should see a list of directories, separated with a ';', where windows will look for commands. There should be a section that looks something like this:
c:\wamp\bin\php\php5.4.16\;
Make sure that points to the directory that contains php.exe.
Also in that directory (for wamp systems) should be php.ini and phpForApache.ini, make sure that the openssl lines in both are uncommented. My experience suggests that the GUI only sets the 'ForApache' version, so I just use a text editor on both.
If you installed composer using the johnstevenson/composer-setup as suggested by Mamba, it should have captured the path to php.exe as it was installed. If that was wrong, or you changed your system after that, it could be pointing to the wrong place. Go to control panel - programs and right click on composer and choose change. Follow the prompts to reinstall it, and make sure that the path to php.exe points to the right place, for example, c:\wamp\bin\php\php5.4.16\php.exe