cbutler Posted October 31, 2010 Posted October 31, 2010 I need to embed PHP in a client's existing HTML files, and tried the usual changes to .htaccess : AddType application/x-httpd-php .htm AddType application/x-httpd-php .html AddHandler application/x-httpd-php .htm AddHandler application/x-httpd-php .html I've introduced little PHP code to the client's HTML files, but all of it is ignored. The "AddType" option produces a Mac pop-up asking what application I wish to use, while the AddHandler option is just ignored. I'm on philadelphia, which is probably an older codebase to avoid breaking older PHP-based websites like some of mine. I've been with TCH a while... FYI, I develop on Snow Leopard running Apache2 and PHP 5.3, where the above changes result in proper PHP pre-processing of my client's HTML files. Thanks for any help. Chris Quote
TCH-Bruce Posted October 31, 2010 Posted October 31, 2010 As far as I know those changes to your .htaccess file are all that are needed. You can open a ticket with the help desk to verify. Quote
Bob Crabb Posted November 1, 2010 Posted November 1, 2010 See if this works: AddHandler application/x-httpd-php5 .html Quote
cbutler Posted November 1, 2010 Author Posted November 1, 2010 Bob... Thanks very much. "php5" seems to have done the trick. Great forum, guys... Chris Quote
Bob Crabb Posted November 1, 2010 Posted November 1, 2010 (edited) Chris, I'm glad that helped. I kindof stumbled upon this a couple of months ago when I had the opposite problem that you had. I was adding some features to the one site that I have which uses php in an html file, and downloaded the files from the TCH server to put into WAMPSERVER (running PHP 5.3) on my laptop in order to develop the new functions. I chased my tail for an hour or so, perplexed by the fact that none of the php worked in WAMPSERVER. Finally, I noticed that the AddHandler line in my .htaccess file had apparently been modified during the last PHP upgrade on the server, changing it to the line referenced in the post above. In order to make it work in WAMPSERVER, I had to delete the "5". Don't you love it ... just when we think that we have a handle on some of this stuff, an obscure little oddity like this sneaks up and gives us a poke in the ribs. Edited November 2, 2010 by Bob Crabb Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.