Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
My PHP tags aren't being interpretted

Posted by admin (Graham Ellis), 13 January 2005
OK ... I've seen this question in email a couple of times, so feel it's worth posting here to increase the "FAQ" value of this place.

Q Why aren't my PHP tags interpretted when I put them into a web page?   When I call up the page and "view source", I see them all, and the display in my browser looks really odd.

A Possible causes:

1. You have named your files with a .htm or .html extension which usually (configuration dependent) means that they won't be parsed by your server for PHP content
(Solution - rename files or reconfigure the server)

2. You are writing the files on your own computer and viewing the files through a file:// type URL rather than an http:// type URL.  Than means that you aren't using your web server at all, so there's nothing to interpret the PHP.
(Solution - upload the files to a server, or run and use one locally)

3. Your web server doesn't support PHP at present
(Solution - install PHP, or move to a server that supports it)

Posted by Chris_Isaac (Chris Isaac), 19 January 2005

Good timing with this as I'm having this problem at the moment.

It is because of the extension (.html) but I want to keep it.  Could you please remind me how to configure the server so it will allow PHP files to run with a HTML extension.


Posted by admin (Graham Ellis), 19 January 2005
I have this in my httpd.conf:

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

and on systems where I don't have control over the httpd.conf file, I include something like

AddType application/x-httpd-php .html

into the .htaccess file in any necessary directories

Posted by Chris_Isaac (Chris Isaac), 19 January 2005
Thats brilliant, thanks.

Am I correct in saying, that the 1st option would do it for the whole server, where if you used the 2nd option you could limit it to certain directories?


Posted by admin (Graham Ellis), 19 January 2005
Yep, that's it

Posted by Chris_Isaac (Chris Isaac), 19 January 2005
Thanks again.

This page is a thread posted to the opentalk forum at and archived here for reference. To jump to the archive index please follow this link.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2024: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: • WEB: • SKYPE: wellho