Forum Moderators: coopster

Message Too Old, No Replies

Help:: Apache2 clean install - PHP will process only *.php document

Html documents with php are not being processed

         

sneaks

2:18 pm on Apr 27, 2005 (gmt 0)

10+ Year Member



test.php:
<?
echo"this works";
?>

--
test.html:
<body>
<head>
<title>but guess what</title>
</head>
<body>
<?
echo"this doesnt";
?>
</body>
</html>
--

i just did a manual reinstall of apache2 and php5
(used [webmasterworld.com...] as my guide)

thx for any advice
j.d.

gliff

2:34 pm on Apr 27, 2005 (gmt 0)

10+ Year Member



You need to tell Apache to parse .html files for PHP code. Apache, by default, won't do this.

Search in your apache config file for


AddHandler application/x-httpd-php .php
or
AddType application/x-httpd-php .php

These are the lines that tell Apache to parse your .php files for PHP code. Add the following "new line" to turn on parsing for .html files


AddHandler application/x-httpd-php .php
AddHandler application/x-httpd-php .html #new line

or if you're using AddType for some reason


AddType application/x-httpd-php .php
AddType application/x-httpd-php .html #newline

sneaks

3:29 pm on Apr 27, 2005 (gmt 0)

10+ Year Member



you rule... thanks for taking the time to help me out... now i am going to go do the same for a few places i know where people are experiencing the same problems...

i was only using the 'addtype'

jd

jatar_k

6:23 pm on Apr 27, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



and Welcome to WebmasterWorld sneaks