A script to translate PHP requests into FastCGI requests, thus allowing hosting of FastCGI apps (good) on any PHP-compatible web host (cheap, common).
The auto-spawning feature requires that PHP have the shell_exec feature enabled
Currently only Unix sockets are supported as FastCGI transport; TCP sockets shouldn't be too hard to add.
Create a spawn-fcgi.conf.php file::
<?php define("SPAWN", "spawn-fcgi -s /tmp/fcgi.sock -- python demo.py fastcgi"); define("SOCKET", "/tmp/fcgi.sock"); ?>
Change the SPAWN define to be a command which creates a daemon process and a Unix socket.
Change the SOCKET define to point at said socket.
Modified to take request data from the environment rather than from function parameters.
PHP port + modifications (c) 2012 Shish <firstname.lastname@example.org>