Jump to content

Recommended Posts

Posted

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

Posted (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. :eek:

Edited by Bob Crabb

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...