I know that PHP is compiled to byte code before it is run on the server, and then that byte code can be cached so that the whole script doesn't have to be re-interpreted with every web access.
But can you "compile" PHP code and upload a binary-ish file, which will just be run by the byte code interpreter?
PHP is a server-side scripting language. That means a PHP script is executed on the server, the output is built on the server, and the result is sent as HTML to the client browser for rendering. It is quite common to code PHP within HTML in a script.
Apache web server The -dev package is required in order to build PHP.
Basically, PHP is interpreted but PHP is compiled down to an intermediate bytecode that is then interpreted by the runtime Zend engine.
After this question was asked, Facebook launched HipHop for PHP which is probably the best-tested PHP compiler to date (seeing as it ran one of the world’s 10 biggest websites). However, Facebook discontinued it in favour of HHVM, which is a virtual machine, not a compiler.
Beyond that, googling PHP compiler
turns up a number of 3rd party solutions.
PeachPie
Phalanger
phc
Roadsend PHP Compiler
bcompiler
bcompiler_write_exe_footer()
manual)Project Zero
Bambalam
BinaryPHP
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With