Skip to content
Advertisement

Compile a PHP script in Linux

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?

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.
What I would like is something like py2exe that does it in the script itself.

Advertisement

Answer

Check out phc: the PHP compiler

If you just want to run it like a script, you may not need to compile it per se, but just run it via the command line. Read running PHP via the command line.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement