This is a very quick and dirty way of setting up a PAGI application via FastAGI. You might find the code useful even to launching your own non-PAGI apps.
Copy config.ini.example to config.ini.
Edit config.ini
The [php] section can be filled with options to be set by ini_set automagically. The [server] section customizes things like address to listen for connections:
Just do a $ php fastagi.php /path/to/my/config.ini &
You may kill(1) the process if you want to terminate it.