Forum Moderators: phranque

Message Too Old, No Replies

httpd.conf edit

Problem with parsing HTML for PHP

         

henry0

12:29 pm on Aug 28, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I have a dedicated server where WebmasterWorld used to be hosted

I need HTML to parse PHP

But I have not seen such a HTTPD conf before

How will you modify it to allow HTML to parse PHP
.PHP . HTML

<IfModule mod_php5.c>
AddType application/x-httpd-php .php .php5 .php4 .php3 .phtml
AddType application/x-httpd-php-source .phps
</IfModule>

(I use php5)

Thanks

<edit>
Sorry, typo in my header, can't fix it
indeed it should read HTTPD.conf :)
</edit>

Caterham

1:02 pm on Aug 28, 2006 (gmt 0)

10+ Year Member



Yust add it and restart apache

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

But anyway: AddHandler instead of AddTyle would be more correct.

henry0

1:10 pm on Aug 28, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks
easier than I tought :)
Henry

jdMorgan

3:58 pm on Aug 28, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



See also comments in this thread: [webmasterworld.com...]

Jim

coopster

4:15 pm on Aug 28, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



... and this thread, with it's associated links, really gets into the details:

Do I have to change .html to .php? [webmasterworld.com]

henry0

4:19 pm on Aug 28, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks JD

HERE IS THE WORKING WAY :(PHP5)
if yours reads like this
<IfModule mod_php5.c>
AddType application/x-httpd-php .php .php5 .php4 .php3 .phtml
AddType application/x-httpd-php-source .phps
</IfModule>
1)Add .htm .html to:
php .php .php5 .php4 .php3 .phtml (it's located about 2/3 down the file)

2)Rem (a few lines below) .htm .html
from: AddHandler server-parsed .shtml .htm .html

Reason why:
htm and html being able to be parsed for SSI
if left will be conflicting if parsed as PHP.

Those final explanations were offered by my server maintenance team.