Login / Status
developer.Resource
Home . Development . Articles . Using PHP with mod_fcgid
Sponsors
hosted by punkt.deTYPO3 and Open Source Magazine
<<  Intended Audience  Advantages of mod_fcgid Configuration >> 

Advantages of mod_fcgid

  1. Speed
    mod_fcgid seems to be as fast as the traditional mod_php Apache module. However, it also allows to be run on a multi threaded Apache server. For various reasons this still does not work reliable with mod_php4 / mod_php5.

  2. Configuration flexibility
    With mod_fcgid it is possible to run many different PHP versions on the same server, and even with multiple different users.

Disadvantages of mod_fcgid

  1. Installation is more complex
    Installation of PHP using mod_fcgid is probably more difficult than setting up mod_php5, mainly because there is only a few documentation about it that can be found. However, since you found this document, you may be lucky...

Installation

Prerequisites

This manual is designed for Debian Etch servers. It expects a server running Apache 2.x. Basically this should work equally for other systems – they probably just use different paths and package names... 

Installation of packages

The following packages are required: 

  1. php5-cgi
    This is the CGI binary of PHP5. It was compiled with FCGI support and works perfectly together with mod_fcgid.

  2. libapache2-mod-fcgid
    This is the FCGID module

  3. apache2-mpm-worker
    This is the multi threaded multi-processing module (MPM) for Apache2. It replaces apache2-mpm-prefork with is a single-threaded MPM and is required by mod_php4 / mod_php5. Of course these packages must also be removed.
    Keep in mind that you may want to make a backup of your current php.ini, because php5-cgi will set up a new configuration file.

    # apt-get -u install php5-cgi libapache2-mod-fcgid apache2-mpm-worker