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.
You can execute linux commands within a php script - all you have to do is put the command line in brackits (`). And also concentrate on exec() , this and shell_exec() .. Save this answer.
The short answer is "no". The current implementation of PHP is that of an interpreted language.
You can run PHP scripts in the Command Line for a particular PHP version used in Plesk.
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.
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