If you create (setup) virtual server by means of Virtualmin, and use it in FCGI mode, then the wrapper create with the following content:
#!/bin/bash
PHPRC=$PWD/../etc/php5
export PHPRC
umask 022
export PHP_FCGI_CHILDREN
PHP_FCGI_MAX_REQUESTS=99999
export PHP_FCGI_MAX_REQUESTS
SCRIPT_FILENAME=$PATH_TRANSLATED
export SCRIPT_FILENAME
exec /usr/bin/php-cgi
It seems wrong though, based on mod_fcgid documentation, as it shouldn't have PHP_FCGI_CHILDREN directive in it.
PHP child process management (PHP_FCGI_CHILDREN) should always be disabled with mod_fcgid, which will only route one request at a time to application processes it has spawned; thus, any child processes created by PHP will not be used effectively. (Additionally, the PHP child processes may not be terminated properly.) By default, and with the environment variable setting PHP_FCGI_CHILDREN=0, PHP child process management is disabled. The popular APC opcode cache for PHP cannot share a cache between PHP FastCGI processes unless PHP manages the child processes. Thus, the effectiveness of the cache is limited with mod_fcgid; concurrent PHP requests will use different opcode caches.
http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html
You don't explicitly set PHP_FCGI_CHILDREN but why is it exported then?
Comments
Submitted by JamieCameron on Fri, 04/18/2014 - 16:34 Comment #1
Virtualmin has the ability to set it, but it is disable by default. The var is exported just in case it does get set - but in your file, this does nothing.
Yes, yes, I know.
Just wrote to help to keep the code clean and precise.
For me, it's not only making things work. :)
Thank you.