I'm building a small web server in C++, and I'm trying to add support for POST requests for PHP pages at the moment.
However, I don't know how I should pass the POST request body to the PHP executable. I've seen some examples where environment variables are set and php-cgi is called, but I haven't seen a definitive list of when to set which variables.
If I have the POST body data in a string, what's the best way of executing a POST request on the required PHP file using php-cgi? My setup works for PHP files where no arguments or POST data is sent from the web server to the executable.