fastCGI and PHP just wont work!

Discussion in 'Server Operation' started by meridianblade, Dec 10, 2006.

  1. meridianblade

    meridianblade New Member

    Hey guys, I am absolutely stressed out with this, I just cant figure it out. Im trying to get fastCGI to work on Apache/1.3.37 with php-4.4.3.

    I need to run phpsuexec and eaccelerator together and for that I need to get fastCGI working on my box.

    Here's what I have done so far:

    I downloaded and compiled fastCGI.

    Ran the following commands:
    Code:
    /usr/local/apache/bin/apxs -o mod_fastcgi.so -c *.c
    /usr/local/apache/bin/apxs -i -a -n fastcgi mod_fastcgi.so
    so my server returns and shows that fastCGI is loading:
    Server Version: Apache/1.3.37 (Unix) mod_fastcgi/2.4.2 mod_gzip/1.3.26.1a mod_auth_passthrough/1.8 mod_log_bytes/1.2 mod_bwlimited/1.4 mod_ssl/2.8.28 OpenSSL/0.9.7a PHP-CGI/0.1b

    I added the following to the bottom of my httpd.conf
    Code:
    <IfModule mod_fastcgi.c>
        FastCgiIpcDir /tmp/fcgi_ipc/
        AddHandler fastcgi-script .fcgi
        FastCgiSuExec /usr/local/apache/bin/suexec
    </IfModule>
    FastCgiConfig -maxClassProcesses 20 -maxProcesses 20 -minProcesses 1 -processSlack 1 -idle-timeout 120
    
    
    then:
    Code:
    mkdir -p /tmp/fcgi_ipc
    chmod 755 /tmp/fcgi_ipc -R
    
    then I compiled PHP-4.4.3 with the following:
    Code:
    ./configure --prefix=/usr --with-xml --enable-bcmath --enable-calendar --with-curl --enable-ftp --with-gd --with-jpeg-dir=/usr/local --with-png-dir=/usr --with-xpm-dir=/usr/X11R6 --enable-magic-quotes --with-mysqli --with-mysql=/usr --enable-discard-path --with-pear --enable-sockets --enable-track-vars --with-zlib --enable-force-cgi-redirect -–enable-fastcgi
    
    make 
    make install
    
    finally a service httpd restart

    needless to say my server api still shows CGI and a php -v doesnt display fastCGI at all.

    What am I missing guys? :-(

    Thanks for your help in advance!
     
  2. falko

    falko Super Moderator

    What does a phpinfo page show?
    Create a PHP file like this:
    PHP:
    <?php
    phpinfo
    ();
    ?>
    and access it in your browser. Does it show fastcgi?
     
  3. meridianblade

    meridianblade New Member

    Hey if you want you can look at here:
    http://www.crgn.net/info.php

    '--enable-fastcgi' is in the config.

    also:
    Code:
    root@host [~]# php -v
    PHP 4.4.3 (cli) (built: Dec  9 2006 11:13:27)
    Copyright (c) 1997-2006 The PHP Group
    Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
        with eAccelerator v0.9.3, Copyright (c) 2004-2005 eAccelerator, by eAccelerator
        with Zend Extension Manager v1.0.9, Copyright (c) 2003-2006, by Zend Technologies
        with Zend Optimizer v2.6.2, Copyright (c) 1998-2006, by Zend Technologies
    
    does not show fast cgi.

    from my httpd.conf:

    Code:
    LoadModule fastcgi_module     libexec/mod_fastcgi.so
    AddModule mod_fastcgi.c
    
    <IfModule mod_fastcgi.c>
        FastCgiIpcDir /tmp/fcgi_ipc/
        AddHandler fastcgi-script .fcgi
        FastCgiSuExec /usr/local/apache/bin/suexec
    Action application/x-httpd-php4 "/php4.fcgi"
    AddType application/x-httpd-php4 .php
    AddType application/x-httpd-php4 .php4
    AddType application/x-httpd-php4 .php3
    AddType application/x-httpd-php-source .phps
    AddType application/x-httpd-php4 .phtml
    
    </IfModule>
    FastCgiConfig -maxClassProcesses 20 -maxProcesses 20 -minProcesses 1 -processSlack 1 -idle-timeout 120
    
    
    Thanks!
     
  4. falko

    falko Super Moderator

    I think this looks good. :)
     
  5. misterm

    misterm HowtoForge Supporter

    Hello with all

    I have this error under the archlinux....

    MM:confused:
     
  6. meridianblade

    meridianblade New Member

    Hum, I thought it would tell me that fast cgi was running with the command php -v. How can I tell if it's running or not? I just have the feeling im missing something :-(
     
  7. meridianblade

    meridianblade New Member

    It's not working, I just realized that eAccelerator works with fastCGI and as a apache module only, not regular CGI, so looking down at the eAccelerator entry it says false to both.

    uhg, im so lost :(
     
  8. falko

    falko Super Moderator

  9. misterm

    misterm HowtoForge Supporter

    Hello with all

    Good year 2007

    Then veiled, all functions starting from the configuration, but when I decontaminate php in my file httpd.conf, is that, when I to start again apache, it me but that like error

    What to make?

    thank you

    mm:confused: ;)
     
  10. falko

    falko Super Moderator

    What's in Vhosts_ispconfig.conf?

    Is the PHP module included in your Apache configuration?
     
  11. misterm

    misterm HowtoForge Supporter

    error fastcgi

    Hello

    All function for the installation of fastcgi under the archlinux, but when, I activate these parameters in my file httpd.conf (version to use, apache 1.3.37):

    but, when I start again the daemons apache, it me but an error...

    What I must make.....

    Yours sincerely

    MM:eek:
     
  12. martinfst

    martinfst HowtoForge Supporter

    This error looks like a rewrite error somewhere to me. Does this error happen when you start apache or when you access a webpage?
     
  13. falko

    falko Super Moderator

    It seems you have a redirect loop somewhere... Please check Apache's error log.
     
  14. misterm

    misterm HowtoForge Supporter

    Last edited: Jan 13, 2007

Share This Page