First,make sure you have PHP installed o your computer. If you have then test if it is working by using the following code:
Save these lines to a file called test.php and put it in your web root. Now access it by using a browser. If you can see all the php settings/configurations then php is installed on your machine. If php is not installed then it will show the text of the script.