Am using windows 8 n this issue got resolved by changing the environment variables
follow these steps: Open my computer properties->advanced system settings->Environment variables. Under 'system variables', select 'path' and click on 'edit' In 'variable value', add 'C:\php;' OR the path where php installed.
click OK and apply the settings and restart the system. It should work.