# PHP execution

The phpcgi handler executes PHP scripts using the CGI interface. As long as this module doesn't use any native library but the PHP CGI, it will work with PHP3, PHP4 and PHP5.

## Parameters

It inheritates the CGI executing module parameters and adds a new one:

- Interpreter path: It lets you define a path to the PHP interpreter
- ChangeUser [on | off]: It interprets each php as it owner user

## Examples

The most common example of this module use is:

    Extension php, php4 {
       Handler phpcgi
    }

If you want to use a different PHP interpreter for both PHP4 and PHP5, you just have to use two different extension and asociate a interpreter which each one:

    Extension php4 {
       Handler phpcgi {
          Interpreter /usr/bin/php4-cgi
       }
    }

    Extension php5, php {
       Handler phpcgi {
          Interpreter /usr/bin/php5-cgi
       }
    }

You can interpret each php file as the user that owns the file instead of the user defined in cherokee.conf. This option provides additional security to run php files.

    Extension php, php4 {
       Handler phpcgi {
          ChangeUser on
       }
    }

    Extension php, php4 {
       Handler phpcgi {
          ChangeUser on
          Interpreter /usr/bin/php4-cgi
       }
    }