Hi guys, We are in the process of choosing the technology for the presentation layer of our application and need some info about it. Our business layer is built with C++ and we are planning to to use PHP to build the presentation layer. Now the question is how to interface these two layers? How to call a C++ function from PHP? We are on Linux so COM could not be an option? So is CORBA the only option? And if yes then how to go about that? I think one option could be interfacing these two via Java class but sounds silly. Help me out.... Thanks in advance Regards, Alok
I haven't gone into much interaction between PHP and C++; I guess you could consider writing a custom PHP extension that will allow you to link with the C++ API (never done it myself to be honest, always had it done for me 🙂 - sections V might be a good place to start on this.
Of course, if all else fails, there's wlays that traditional software communication technology - STDIN and STDOUT (as used by PHP's Program Execution functions 🙂
sockets, sytem(), exec(), the backtick operator, STDIN, STDOUT...
Sockets would probably be your best choice, assuming you can make your C++ script listen on a specific port, have PHP open a socket, send data, recieve data...