php+fastcgi on Apache

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!


I'm trying to get FastCGI to run normal php scripts from mod_fastcgi.
The documentation seems outdated. So far I have done the following:

-------downloaded and re-installed php, with:
./configure --enable-fastcgi    (no errors)
make install
cp sapi/cgi/php-cgi /usr/local/apache2/htdocs/fcgi/

---------put this in httpd.conf (as you can see I've tried a few other
approaches too):
LoadModule fastcgi_module     modules/
<IfModule mod_fastcgi.c>
  #AddType application/x-httpd-fastphp .fphp

  # Dynamic Settings
  <Directory /usr/local/apache2/htdocs/fcgi>
    Options +ExecCGI
    SetHandler  fastcgi-script

  #AddHandler  fastcgi-script fcgi fphp

  # Static Settings
  FastCgiServer /usr/local/apache2/htdocs/fcgi/php-fcgi
  # FastCgiConfig -singleThreshold 1

  Action fastcgi-script /fcgi/php-fcgi
  Action x-httpd-fastphp /fcgi/php-fcgi

(also tried with and without the mod_php being loaded).

Currently, the server will run regular fastcgi apps (say, written in C
using the FCGX_Accept loop) that are in /fcgi correctly, but not
regular php scripts. logs/error_log gives this repeatedly:

[warn] FastCGI: (dynamic) server "/usr/local/apache2/htdocs/fcgi/
test.php" has failed to remain running for 30 seconds given 3
attempts, its restart interval has been backed off to 600 seconds

So it appears it's still running php scripts with the normal mod_php,
or else the newly-compiled php isn't working (When I just run fcgi/
fcgi somescript.php, it spews out the contents just like regular;
isn't it supposed to fork and await input from the server?).

Running strace on httpd does not show it opening the php-cgi binary
when I request a php page; is there a way to debug what it's doing vs.
should be doing when loading that config? Docs are sparse, help

------System --- info:
# uname -a
Linux myserver 2.6.22-14-server #1 SMP Sun Oct 14 22:09:15 GMT 2007
x86_64 GNU/Linux

(It's ubuntu, but all of the below I downloaded and compiled from

# apachectl -v
Server version: Apache/2.2.6 (Unix)
Server built:   Jan 11 2008 16:08:58

# /usr/local/apache2/htdocs/fcgi/php-cgi -v
PHP 5.2.5 (cgi-fcgi) (built: Jan 18 2008 16:15:38)

fastcgi: 2.4.0



Site Timeline