Sun Java System Web Server 6.1 2005Q4 SP5 Release Notes

PHP Compatibility

PHP, the popular page scripting language available from the PHP group (, can be used with the Sun Java System Web Server using one of three supported APIs: CGI, NSAPI, and FastCGI. The PHP group provides detailed instructions on its Web site for configuring the PHP software to use any of the three supported APIs.

The CGI API is the most stable interface that can be used but will suffer from performance limitations inherent in CGI.

NSAPI utilizes 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.

The FastCGI interface provides a compromise between performance and stability by allowing 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 cause the Web Server to crash. For this reason Sun recommends use of the FastCGI interface with the PHP software.

The FastCGI interface is supported with the Web Server via the installation of the FastCGI Add-On available from

Note –

The PHP software makes use of two environment variables to control the life cycle of PHP processes when run as a FastCGI process. 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. Sun recommends against the use of PHP_FCGI_CHILDREN and recommends instead the FastCGI Add-On configuration parameter min-procs to control the minimum number of PHP processes.