CGI binary is linked to mime-type:
ScriptAlias /php/ /usr/local/bin/php-cgi
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php.exe"
On a request, Apache:
- checks if there is a handler for the mime type
- fills in needed environment variables
- executes the CGI processor