Page 1 of 1

Parse .html file as php5 via .htaccess file

PostPosted: 12. January 2011 22:53
by jean01
Maintaining a website that has two html files that are set to be parsed through php using the following .htaccess commands:

<Files index.html>
AddType application/x-httpd-php5 .html
</Files>
<Files pagename.html>
AddType application/x-httpd-php5 .html
</Files>
How do I get XAMPP to recognize these commands?

The .htaccess file itself also contains ErrorDocument commands that are behaving properly.

My install is:
XAMPP for Windows Version 1.7.3
Windows 6.0 Build 6002 Platform 2 Service Pack 2
I am running VISTA, if that matters.

Thanks!
jean
PS

Re: Parse .html file as php5 via .htaccess file

PostPosted: 13. January 2011 03:34
by Sharley
Suggested Google Search

Xampp only uses the one version of PHP and is compiled as a Module not as a CGI.
So x-httpd-php5 is not required, use just x-httpd-php instead.

For some help with creating and correcting your .htaccess file see these links:
How To Parse HTML Files As PHP
Make PHP to work in your HTML files with .htacess

Please post back if you find the solution that allows you to move forward.

Thanks and HTH.

Re: Parse .html file as php5 via .htaccess file

PostPosted: 13. January 2011 20:45
by jean01
Sharley wrote:Xampp only uses the one version of PHP and is compiled as a Module not as a CGI.
So x-httpd-php5 is not required, use just x-httpd-php instead.

AddType application/x-httpd-php .html
works in XAMPP, thanks very much!
The web host still requires
AddType application/x-httpd-php5 .html
I checked and this is indeed because they still offer more than one version of php, as discussed in one of the links you provided:

I'm not, and likely never will be, particularly well versed in Apache so I do have these elementary issues from time to time.
Thanks very much for your help!!
Jean