What php is the means of integration with other languages?

    2 answers 2

    Specify.

    If you need two programs to “make friends” - well, open a socket / pipe (or allocate shared memory or any other IPC method) and speak a well-known protocol (GPB, Thrift, MsgPack, JSON-RPC, BERT-RPC, ... no) numbers).

    If you have a code in one language, and you want to use it from PHP - more specifically, what language is it. In general, everything is possible, for example, a wrapper for the Zend API is done around the code, it is loaded via dl() and called.

    Well, or, as already written, exec() / system() is also an option for its cases. popen() , again, as a special case of communication via file descriptors (stdin / stdout / stderr, in this case). And in general, you run the program through exec() , and it will return PHP via HTTP (to a special address where only requests from a trusted network and / or authorization are received).

      There are exec(), system() functions. Look in this direction.