| |||||||||||
| |||||||||||
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 HiGood 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. Thanks. ![]() ![]() ![]() 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? Thanks Chris Posted by admin (Graham Ellis), 19 January 2005 Yep, that's itPosted by Chris_Isaac (Chris Isaac), 19 January 2005 Thanks again.This page is a thread posted to the opentalk forum
at www.opentalk.org.uk and
archived here for reference. To jump to the archive index please
follow this link.
|
| ||||||||||
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho |