A Mind Less Ordinary

The web presence of Dave Ingram

mod_fakephp Apache module

This is a very simple module that installs null handlers for the various PHP configuration directives, to allow you to use the htscanner extension with PHP as CGI.

The source code is released under a BSD-like licence, and is available from the Subversion repository:

svn co http://svn.dmi.me.uk/mod_fakephp/trunk mod_fakephp

Installing and activating this module allows you to use the php_value and php_flag directives in Apache configuration files without warnings, without requiring mod_php to be installed. This means you can use PHP in CGI mode (e.g. via mod_suphp and the htscanner extension) as if it was a module.

Note that this module does not interpret the directives – it merely suppresses Apache warnings so that they can be parsed by other means.

An ebuild is also available for Gentoo systems – see below for information on using it.

This module is currently in use on this webserver.

Gentoo ebuild

In order to use the ebuild, follow these steps:

  1. Download the ebuild, additional config file and manifest.
  2. If you have a Portage overlay directory, then skip to the next step, otherwise:
    1. Create the overlay directory /usr/portage/local/overlay
    2. Add this line to the end of your /etc/make.conf:
      PORTDIR_OVERLAY="${PORTDIR_OVERLAY} /usr/portage/local/overlay
  3. Place the files into your Portage overlay directory, with the ebuild and manifest in
    /path/to/overlay/www-apache/mod_fakephp/
    and the config file in
    /path/to/overlay/www-apache/mod_fakephp/files/
  4. Add www-apache/mod_fakephp ~x86 to your /etc/portage/package.keywords file.
  5. Install the module using emerge -av mod_fakephp.
  6. Activate the module by including -DFAKEPHP in the APACHE_OPTS variable in /etc/conf.d/apache2
  7. Restart Apache: /etc/init.d/apache2 restart