I have been wrestling with it the whole afternoon, and finally I get it correctly, not correct enough though. at least the server execute php files as expected now.
but i still have the concern, that I doubt my current setup is a true
FAST CGI, because the php-cgi processes are still spawned by the httpd process, and the PID changes fast.
root@vps [~]# ps axj|egrep 'php|pid' -i PPID PID PGID SID TTY TPGID STAT UID TIME COMMAND 21128 23427 13708 13708 ? -1 S 501 0:01 php-cgi 21128 23428 13708 13708 ? -1 R 501 0:01 php-cgi 21128 23431 13708 13708 ? -1 S 501 0:00 php-cgi
and 21128 is the pid of httpd process if there are no requests coming into the apache, then no php process spawned.
Isn't it supposed to have separate php processes running , that is not spawned by httpd upon requests coming in? I have below in httpd.conf, with FastCgiConfig not commented out, it does starts php-cgi process with not-changing PID, but with a strace tells me the process is not doing anything, it was just 'accept(0,'.. waiting for incoming socket.
<IfModule mod_fastcgi.c> AddHandler fastcgi-script .fcgi FastCgiWrapper /usr/local/apache/bin/suexec FastCgiConfig -minProcesses 1 -maxProcesses 10 -singleThreshold 100 FastCgiServer /usr/local/apache/fcgi-bin/php-cgi2 -processes 1 -user socialth -group socialth </IfModule>
I have below config for my site:
<VirtualHost..> .... <Directory..> <IfModule mod_fastcgi.c> AddType application/x-httpd-php .php AddHandler php-fastcgi .php Action php-fastcgi /fcgi-bin/php-cgi2 </IfModule> </Directory> </Directory> </VirtualHost>
it works, but i don't really think it's the best behavior of mod_fastcgi, i even think it's the same as mod_fcgid , which is what i want to eliminate