Existing answers cover bases well enough for possible ways to compile your PHP code into an executable file. However, you may not have to go on these topics based on your question.
If all you are looking for is a way to run php scripts on Windows that are outside the Apache server, then all you need to do is install php on your Windows machine. Then you can run any php script from the command line by simply typing > PHP .php
You can download the Windows installation package for this from http://windows.php.net/download/
source share