Jump to content

Apache 2 setup for parsing .html files with PHP content


greenhornet

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

*snip*

<IfModule mod_dir.c>

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

</IfModule>

 

<IfModule mod_php4.c>

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

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

</IfModule>

*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

 

*snip*

<Files *.php>

SetOutputFilter PHP

SetInputFilter PHP

LimitRequestBody 524288

</Files>

 

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!!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.