PHP exec() seems to be the way to go.
http://us2.php.net/function.exec
I would approach this follows:
1) log into a shell on your server
2) become www-data (or whatever user runs PHP on your server).
('sudo su www-data' or something like that)
3) Make a command that actually works and successfully calls your C++
lib and produces the output you expect.
4) Once you figured that out, try it via PHP. (I am not sure if exec()
will do what you want, if not, have also a look at passthru() if you
receive binary data back from the process.
5) Make sure you are not creating a securityhole. Have a look at
functions like escapeshellcmd()
6) Once the above all works, you can use it from the clientside via
JavaScript. In case you want to make a call from the client, use
XMLHTTPREQUEST.
In case you only run it at the server, run it and use its output
appropriately. You didn't give enough information here.
Regards,
Erwin Moller