Jump to content


This topic is now archived and is closed to further replies.


Apache 2 setup for parsing .html files with PHP content

Recommended Posts

Hi There,


I am running one server with PHP 4.1 and Apache 1.3, in this server there are a number of old html files that have some <?PHP ... ?> scripts in them. These were parsed by PHP fine, as well as all the regular .php files.


The following lines are the in Apache 1.3 httpd.conf


<IfModule mod_dir.c>

DirectoryIndex index.html index.htm index.shtml index.php index.php4 index.php3 index.phtml index.cgi



<IfModule mod_php4.c>

AddType application/x-httpd-php .php .php4 .php3 .phtml .html .htm

AddType application/x-httpd-php-source .phps


*end snip*


Now I am trying to move these websites to a mew server running Apache 2.0 and PHP 4.2, with the following in /etc/httpd/conf.d/php.conf



<Files *.php>

SetOutputFilter PHP

SetInputFilter PHP

LimitRequestBody 524288



DirectoryIndex index.php index.php3 index.php4


*end snip*


and the following in /etc/httpd/conf/httpd.conf;


AddType application/x-httpd-php .html .htm



I\'m a little confused, this setup on Apache2 seems to break some things, like when a user gets a 404 error it downloads an empty file with the same name as the bogus file they had in the URL?


What is the proper way to setup PHP 4.2 (or 4.3) with Apache 2.0??? This will be on a Red Hat 9.0 server with PHP + Apache installed from RPMs.


Thanks heaps for your help guys, I love the way this site is focused on PHP hosting and development, I\'ll be spending a lot more time here!!

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.