Apache Cookbook: Solutions and Examples for Apache Administrators

Problem

You want to enable PHP scripts on your server.

Solution

If you have mod_php installed, use AddHandler to map .php and .phtml files to the PHP handler:

AddHandler application/x-httpd-php .phtml .php

Discussion

This recipe maps all files with .phtml or .php to the PHP handler. You must ensure that the mod_php module is installed.

See Also

  • Recipe 2.5

  • Installation instructions on the mod_php web site at http://www.php.net/manual/en/install.apache.php for Apache 1.3 or http://www.php.net/manual/en/install.apache2.php for Apache 2.0

Категории