<p>I know PHP scripts don't actually compile until they are run. However, say I want to create a small simple program and compile it to a binary without requiring the PHP binary. How could I do this?</p>

<p>I've seen a few IDE's out there that would do this, but either they are all for windows or the Linux versions don't actually build properly.<br>
What I would like is something like py2exe that does it in the script itself.</p>

There is this:
http://www.bambalam.se/bamcompile/
but that compiles to Windows bytecode.  There are a few others, but all I have seen will compile for windows only.
Few More:
http://www.nusphere.com/products/phpdock.htm
Edit: I almost forgot if your looking to make it work on linux without regard for windows you can just add
```
```
#!/usr/bin/php
```
```
to the top of the script and you should be able to run it from the command line.  Don't forget to chmod +x the file first.