Q: How to execute a program from PHP code?
A: Suppose you written a code in java and make it as an executable jar.
Then issue the statement from PHP script:
exec('file.jar');
This function can execute any command or program. But this synchronous.
You have to wait until the program has been executed.