I was going to say this earlier (Piranha has pretty much said it in his last post), but got sidetracked:
When you create a .php file with PHP code, you are not creating a program. The "program" involved is either the php.exe executable file (if you're using the CLI or have interfaced PHP with your web server as a CGI binary) or the software for your webserver (in the even that you installed PHP as an ISAPI filter). As Piranha points out, the .php file you compose is a script that the PHP program interprets.
As such, you need to use a program (such as the php.exe CLI, or a webserver) to interpret your .php scripts.
Now, as to all of your other questions... it sounds like you need to find some very basic tutorials as to what a webserver is, what PHP is, and how your webserver of choice (Apache is a common one) works.