Alright, it's ugly, wrought with problems, and I strongly DISCOURAGE you from doing this, but it IS possible to get what you want...kinda. Yes, it's true, the whole idea of doing PHP is that you sit in front of a browser, point it at a webserver, and that webserver, upon realizing you're asking for one of its PHP files, executes that PHP file first and then sends you the results of that execution as the webpage you see in the browser.
HOWEVER, PHP comes in 2 flavors: CGI version (or basic .EXE file), and ISAPI module (which is like a "plugin" for your webserver if you will). Anything you do in PHP can be tested by going to the command line and typing
drive:\path\to\php.exe drive:\path\to\YourFile.PHP
For our example we'll assume you installed PHP on your box in C:\PHP, and that your PHP scripts are stored in C:\WWWROOT. So the command would be (and I specify full paths so as not to ASSUME anything):
C:\PHP\php.exe C:\WWWROOT\YourFile.PHP
This will result in you seeing as a result the actual HTML code generated by the PHP engine. This is normally made "pretty" by your browser, so you see the nice little results in tables, blah blah blah.
Well, if we can do this, then we can modify this command to redirect the output to a file, using the standard redirectors in NT (and DOS, and Unix, and ...). For our example we'll have a temporary directory called C:\TEMP in which we'll save the output in a file called PHPOutPut.html:
C:\PHP\php.exe C:\WWWROOT\YourFile.PHP > C:\TEMP\PHPOutPut.html
Voila! We now have a perfectly valid output of PHP coding. To view, we simply double-click on this file and let our default browser do its worst.
Taking this one step further, we can now automate these steps and store them in a .BATch file (the DOS/9x/NT command line scripting language basically). For our example we'll call this .BATch file RUNPHP.BAT. So pop up NotePad or your favorite editor and type in the following (what's between the lines):
RUNPHP.BAT
@ off
C:\PHP\php.exe C:\WWWROOT\YourFile.PHP > C:\TEMP\PHPOutPut.html
C:\TEMP\PHPOutPut.html
Note that this .BATch file contains two commands basically: the first runs PHP.EXE and redirects the output of your script in YourFile.PHP to a new file called PHPOutPut.html. The second line is just the path to the output file itself. Odd, I grant you, but what that in effect does is the same as you double-clicking on the file, and since the file has extension .HTML, Windows will fire up your default web browser and load the output file in it.
Now double-click on this file or type it's name at the command prompt
runphp
and voila! The output is automagically displayed in your browser. This is all nice and well, but it's kind of limited to one file we've hardcoded into the .BATch file. As those TV ads always say, though, "But WAIT! There's MORE!"
Now let's go the full distance. Change RUNPHP.BAT to the following:
@ off
C:\PHP\php.exe %1 > C:\TEMP\PHPOutPut.html
C:\TEMP\PHPOutPut.html
This is yet another trick in our .BATch command arsenal, and it basically lets you type in something like the following at the command line:
runphp <somefile.php>
where <somefile.php> is whatever PHP script you want to see the output from. We've now made our .BATch file much more generic.
But what GOOD does all this do, you ask? Well, if you want to, what you do now is store RUNPHP.BAT in a nice, safe location where it's not likely to be deleted. Maybe in C:\PHP or C:\WINDOWS or whatever. Your call.
Now the final step. With this simple .BATch file in place, all you need to do now is find one of your PHP files (I'll assume you're using files with the .PHP extension here) and do the following one time:
Select the PHP file by clicking on it once.
Hold down the SHIFT key and right-click on the file. A popup menu appears but you'll notice one extra entry called "Open with...". This is basically that View|Options|FileTypes business you thought it was.
Select "Open with...". It now lists all known registered programs. DARN, our .BATch file isn't in the list. No problem.
Click the [Other...] button. It brings up the usual Open dialog box.
Browse thru to C:\PHP or wherever you stored that RUNPHP.BAT file. Notice by default this dialog box only wants to show you "Files of type: Program". If you don't see your newly created RUNPHP.BAT file, change this so you see all files.
Select RUNPHP.BAT and click [OK]. You're now back at that registered list of programs, but now your RUNPHP has been added.
To make Windows use this by default when you double-click on such a .PHP file, click the
[x] Always use this program to open this type of file
Now click on [Ok] and VOILA! What you have, in effect done, is made it so that whenever you double-click on a .PHP file, it runs the RUNPHP.BAT file, which takes as its only parameter the name of the file to run through PHP.EXE. It then creates an output file in C:\TEMP called PHPOutPut.HTML, which the .BATch file then loads into your browser.
Does this work? Yes/kinda. Does it always work right? No. Why? Simple. Some things, such as the variable PHP_SELF, have their value based on their relative location within the website. We're kind of violating this by running the PHP script thru the engine directly (at the command line in effect) and then looking at the results. Also note anything that requires PHP interacting with the webserver itself, such as HTTP authentication, is only available if you use the ISAPI module and not the .EXE. So this will NOT work with this .BATch cludge, for the same reason.
Anyway, that's my 2 cents worth, created on the fly after reading your post. I've tested it, and it does work for basic stuff. I created a test.php file which simply contained
<? phpinfo(); ?>
and ran it through RUNPHP.BAT using the "Open with..." feature, and it all worked except for the graphics (they didn't show). So "caveat emptor."
Will I use this personally? No. But that's me. But it can be done...kinda. ;-)