LiteSpeed Web Server supports several environment variables that can be used to customize PHP fCGI applications:

  • PHP_FCGI_CHILDREN=XX

This controls how many child processes the PHP engine process spawns. If set, the PHP engine will be able to spawn multiple child processes for each instance. The Instances setting (in your external application settings) should then be set to “1”. (Normally the Instances setting is used to control the concurrency of PHP engine.) The Max Connections setting should be set to the same value as the maximum number of child processes.

  • PHP_FCGI_MAX_REQUESTS=XXXX

This controls how many requests each child process will handle before exit. It protects against memory leaks inside PHP. For each new child process, the web server will need to reestablish a connection. This value should thus be set as high as possible to increase performance.

  • FCGI_WEB_SERVER_ADDRS=127.0.0.1,192.168.0.1

This controls who can connect to the PHP engine over the network through a TCP socket. In the above example, only 127.0.0.1 and 192.168.0.1 are allowed. This option is not necessary when the PHP engine runs on localhost with a proper Address setting.

  • Admin
  • Last modified: 2015/07/28 19:47
  • by Michael Alegre