note 92797 modified in install.unix.apache2 by danbrown

From: Date: Mon, 10 Aug 2009 15:14:23 +0000
Subject: note 92797 modified in install.unix.apache2 by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-159266@lists.php.net to get a copy of this message
When I upgrade to apache 2.2, this: AddType application/x-httpd-php .php5 AddType application/x-httpd-php .php42 AddType application/x-httpd-php .php4 AddType application/x-httpd-php .php3 AddType application/x-httpd-php .php AddType application/x-httpd-php .phtm AddType application/x-httpd-php .phtml AddType application/x-httpd-php .asp ...does not worked for me, so I did this: <FilesMatch "\.(php*|phtm|phtml|asp|aspx)$"> SetHandler application/x-httpd-php </FilesMatch> Another interesting point with Apache 2.2 is following. Let suppose we installed PHP as module. But for some directory, we need to use PHP as CGI (probably because of custom configuration). This can be done using: <FilesMatch "\.(php*|phtm|phtml|asp|aspx)$"> SetHandler none </FilesMatch> AddType application/x-httpd-php-custom .php Action application/x-httpd-php-custom /cgi-bin/php-huge Note type must be different than "application/x-httpd-php" and also you need to deactivate the handler on sertain extention. You can do mixed configuration: <FilesMatch "\.(php)$"> SetHandler none </FilesMatch> AddType application/x-httpd-php-custom .php Action application/x-httpd-php-custom /cgi-bin/php-huge in such case files like *.php5 and so on will be parsed via module, but *.php will go to php-huge executable. --was-- When I upgrade to apache 2.2, this: AddType application/x-httpd-php .php5 AddType application/x-httpd-php .php42 AddType application/x-httpd-php .php4 AddType application/x-httpd-php .php3 AddType application/x-httpd-php .php AddType application/x-httpd-php .phtm AddType application/x-httpd-php .phtml AddType application/x-httpd-php .asp ...does not worked for me, so I did this: <FilesMatch "\.(php*|phtm|phtml|asp|aspx)$"> SetHandler application/x-httpd-php </FilesMatch> http://php.net/manual/en/install.unix.apache2.php

« previous php.notes (#159266) next »