Toolserver:Switchboard

switchboard is a daemon that allows you to use FastCGI PHP instead of CGI PHP for your PHP scripts. The problem with CGI PHP is that every request creates a new PHP interpreter, which is slow, and for heavily-used scripts, causes a lot of extra load on the system. FastCGI re-uses the same PHP interpreter for several requests, which is much faster.

Unfortunately, Apache's mod_fastcgi has issues with long-scripts (those longer than around 30 seconds). If you have such long-running tools, you might not want to use FastCGI for those. Fortunately, FastCGI can be enabled for particular files or directories without affecting others.

For specific files
Method #1: Rename each file from .php to .phpf. Then change the URL from http://toolserver.org/~jsmith/mytool.php to http://toolserver.org/~jsmith/mytool.phpf. Only files named .phpf will use switchboard; others will use standard CGI PHP.

Method #2: Rename the file as in #1. Then create a .htaccess file that contains: RewriteEngine On RewriteBase /~jsmith/path/to/tool RewriteRule ^mytool.php$ mytool.phpf [PT,L,QSA]

This will allow the same URL (http://toolserver.org/~jsmith/path/to/tool/mytool.php) to keep working.

For all files or an entire directory
Create a .htaccess file which contains:

AddHandler php-fastcgi .php

If you put this in a particular directory, it will only apply to that directory and directories underneath it. If you put it in your top-level public_html, it will apply to all your PHP scripts.