First we need to create our example page:
mkdir -p /srv/www/fcgi echo "<?php phpinfo(); ?>" > /srv/www/fcgi/index.php
Also it helps to start our PHP FastCGI server:
export PHP_FCGI_CHILDREN=64 export PHP_FCGI_MAX_REQUESTS=2345 /opt/php-fcgi/bin/php-cgi -b :9000 &
What we’re doing here is to tell PHP that it’s got to start 64 independent servers waiting to serve requests. After having served 2345 requests any of these servers will quit and restart to prevent our server machine from dying of memory leaks still being caused by PHP.
As a last step, we need to tell our client machine where to find the server “fcgi.test.local”. This is done by adding a line to the file
/etc/hosts
if you’re on Linux or Mac OS or to
C:\Windoze\System32\drivers\etc\hosts
if you’re on a less desireable OS:
192.168.1.100 fcgi.test.local
Make sure to replace the 192.168.1.100 with the actual IP address of the web server you use for testing.

Pingback: External FastCGI With Apache « IT Know-It-All
Great article, but how did you solve the problem with the trailing index.php?
If I call the domain, the php file are provided as a download.
If I add index.php, I get redirected to /virtualpath/index.php/ which results in a 404. Everything else works like a charm…
Can’t really say what the problem with your setup is. Either it’s a missing “DirectoryIndex index.php” statement in the htpd.conf file or your settings for calling the FCGI process are a bit borked. If you could post the settings for your vhost, maybe I could help more then.