How does a webserver interface with PHP
<p>I want to handle http requests via another webserver or own written server in future.</p>

<p>I want to understand how to provide php with request data properly.</p>

<ul>
<li>in what form request data should be provided</li>
<li>how data is provided to php, via stdin or somehow else</li>
<li>how php handles received request data afterwards, any additional actions required to fill $_SERVER variables etc.</li>
</ul>
