Web Servers on Unix and Linux - apache2 processing php files with html extensions

This is Interesting: Free IT Magazines  
Home > Archive > Web Servers on Unix and Linux > February 2005 > apache2 processing php files with html extensions





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author apache2 processing php files with html extensions
dave

2005-02-15, 8:51 pm

Hello,
Apache2 on Unix, with php support compiled in as a dso. Currently to get
support on a page the page has to be renamed with a .php extension. I don't
want to do this, i'd have to rename several dozen pages plus change all the
links within a page. How would i make apache2 handle php processing for all
pages that have either .php, .htm, or .html extensions?
Thanks.
Dave.


sharma

2005-02-16, 7:46 am

Add .html to this php directive in php.ini

1)search for this in php.ini
AddType application/x-httpd-php

2) .html at the end of the line like this

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

if you want htm page to run add .htm ..
AddType application/x-httpd-php .php .html .htm

3)restart Apache...

If you are not having access to php.ini.. put it line 2 in .htacess
file and place it in your webroot...

Hope this helps..

Thanks,
sharma

sharma

2005-02-16, 7:46 am

Hey sorry,

Its not in php.ini...

Its in Apache's configration file, httpd.conf, you need an AddType
directive that matches scripst ending in .php with
application/x-httpd-php.


1)search for this in php.ini
AddType application/x-httpd-php

2) .html at the end of the line like this

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

if you want htm page to run add .htm ..
AddType application/x-httpd-php .php .html .htm

3)restart Apache...

If you are not having access to php.ini.. put it line 2 in .htacess
file and place it in your webroot...

Hope this helps..

Thanks,
sharma

dave

2005-02-16, 5:50 pm

Hello,
Thanks a lot that did it.
Dave.


Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com