PHP: Hypertext Preprocessor (PHP) can be used with the Sun Java System Web Server using one of the three supported APIs; CGI, NSAPI, and FastCGI. PHP is a page scripting language available from the PHP group. The PHP group provides instructions on its Web site (http://www.php.net) for configuring the PHP software to use any of these APIs:
CGI API is the most stable interface that can be used but will suffer from performance limitations inherent in CGI.
NSAPI uses the Sun Java System Web Server's native API to run the PHP software within the web server's memory. This configuration will provide the best performance, but risks crashing the server if non thread safe PHP modules are used.
FastCGI interface provides a compromise between performance and stability. FastCGI enables the PHP software to remain running after serving requests while continuing to run outside of the web server's memory. If an unstable PHP module is used, it will not crash the web server. For this reason use the FastCGI interface with the PHP software.
The FastCGI interface is supported with web server through the installation of the FastCGI add-on available at http://www.sun.com/download/products.xml?id=42d693c3.
When run as a FastCGI process, the PHP software uses the following environment variables to control the life cycle of PHP processes:
PHP_FCGI_CHILDREN determines the number of PHP processes that will be created to respond to requests.
PHP_FCGI_MAX_REQUESTS determines the number of requests a PHP process can respond to before terminating itself and being replaced with a new PHP process.
Instead of using PHP_FCGI_CHILDREN, use the FastCGI add-on configuration parameter min-procs to control the minimum number of PHP processes.