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
if you’re on Linux or Mac OS or to
if you’re on a less desireable OS:
Make sure to replace the 192.168.1.100 with the actual IP address of the web server you use for testing.