I was wondering what would be the best method for creating a web end for interfacing with a C++ program on the server. At first I simply thought just using shell execution from the web server side language (like shell_exec() in PHP), but I was wondering if there is a "better" way. Maybe something more native or is this a bad practice for some reason?
|
|
|||||||
|
|
Web programming with C++ has pretty much gone out of style. The traditional way to do it was with CGI. See here for a tutorial. Or you can add an embedded webserver like mongoose However, I think it's easiest to use PHP's passthru. For example, on one of my sites I have a C++ program that generates images, to display the images I do:
|
|||||||
|
|
Wt, the C++ web toolkit is a library with a set of classes that make it much easier to add a web interface of any complexity to a C++ program. It focuses on the web interface aspects only, and is otherwise non-intrusive to your program. |
|||
|
|
|
I'm sure there are compilable web framework out there for C/C++. However, I'm not familiar with any. What I am familiar with is the ease of which you can extend Python with C/C++. I believe it can be made even simpler by using SWiG. Given that Python has a plethora of web frameworks this may be an option for you. |
|||
|
|