From what I see: your php interpreter is working just fine. But it does not like your php code itself.
Try to make a file named "whatever.html"
and input this as code in that file:
If your php works, it'll output a whole bunch of settings it is using. Just the fact that it does proves your php works in html files.
Next you'll have to figure out what your php script tries to do and what goes south.
Try to take ist step by step.
Crystal ball says you're on shared hosting. Before you tear out any more hair, take a look at their own docs, including the wiki if there is one. They may give the formula for permitting php within html. On mine there's no separate mention of php at all; the bit that enables include files (which may happen to be php) is
AddType text/html .html
AddOutputFilter INCLUDES .html
The first line seems like a tautology -- "html should be read as html" -- but you don't hear me arguing.
Thank you all.
Still no joy... and losing lots of hair from this! Does the .htaccess have to be in the root folder?
What is your hosting environment? Such as: Linux / Apache / MySQL / PHP? Shared, VPS, Dedicated? And are you running PHP scripts as an Apache module, CGI, or fastCGI?
I had a major problem few weeks ago due to fastCGI when I moved from one hosting environment to a new one. Took me all day to find a solution which was nothing like previous syntax:
AddHandler php-script .html
It can be added to .htaccess -- may not work for you but worth a try.
It all depends on how your host has set up their php. One host I work with only needs one line:
AddHandler application/x-httpd-php5 .html .htm
Another host requires this combination:
RemoveHandler .html .htm
AddType application/x-httpd-php .php .html
One host I dropped a long time ago would not work with anything. It wasn't godaddy, but godaddy is one of those kinds of hosts. Lucy24 is right, look and see if your host offers a knowledge base, if not, ask them for their suggestions.
PS it won't work on Windows servers either.
I think you're looking at the wrong problem.
whatever you had when this log entry was created
|[30-Jan-2013 12:20:44] PHP Notice: |
shows that the php interpreter was working.
So whatever you had then worked as far as having a configuration that starts php.
What's likely is that the scripts you have aren;t working (properly), but you're not going to fix that in apache configurations of .htaccess files.
... so now you have to go back and figure out which of your quoted four AddType / AddHandler variants was in effect at the moment the ErrorLog entry was generated ... because whatever you were doing was right :)
as swa66 said right in the beginning, the problem lies in your code, the error message even tells you where - line 116 (or just before, that could be the line with the next ';')
Thank you all! I am now officially bald from this. 1 week on and the frustration is causing me to think about nothing else!
the specifications for the server are below:
PHP Version 5.1.6
Apache 2.0 Handler
Since I am new to the whole concept of PHP - where is line 116? What file? Or....?
Apparently this path also looks wrong in the php file:
include C5T_ROOT . 'comment.php';
A Hello world dummy script is working OK now so this I guess means html is parsing correctly as php....?
What a nightmare!
If a hello world in php is working in a html file: then you're set: php works.
Apparently you're trying to get something pre-made already written in php to work. What exactly ?
Googling for C5T_ROOT and comment.php I find references to something called "Gentlesource comment script". It that what you're trying to use ?
As far as comment fields go: do know that unless you incorporate countermeasures such as a strong CAPTCHA, banning of known bad sources, and a lot of moderation, this is a huge can of worms.
Thank you. Yes you are correct - gentlesource comment script is what I am trying to display on the site but nothing will display. Despite the hello world script showing correctly.
The script in question is <?php echo $c5t_output; ?>
It displays nothing. Not even an error message on the page.
The php error log shows this - despite the hello world working?!
[30-Jan-2013 12:20:44] PHP Notice: Undefined index: identifier_list in /vhost/vhost8/s/t/o/stor.com/www/comments/cache/%%74^748^74858DDB%%admin_identifier_list.tpl.html.php on line 116
[30-Jan-2013 12:21:49] PHP Notice: Undefined index: identifier_list in /vhost/vhost8/s/t/o/stor.com/www/comments/cache/%%74^748^74858DDB%%admin_identifier_list.tpl.html.php on line 116
[30-Jan-2013 12:22:04] PHP Notice: Undefined index: comment_list in /vhost/vhost8/s/t/o/stor.com/www/comments/cache/%%6D^6DC^6DC53361%%admin_comment_list_all.tpl.html.php on line 97
[31-Jan-2013 21:02:02] PHP Notice: Undefined index: comment_list in /vhost/vhost8/s/t/o/stor.com/www/comments/cache/%%6D^6DC^6DC53361%%admin_comment_list_all.tpl.html.php on line 97
Did you follow the installation instructions ?
Did you configure it all properly ?
Doesn't the maker of the software offer support ?
Go to the admin interface and make sure it's configured correctly.
If it has a way to clear/flush/delete/whatever it is named it's cache: do that.
For the rest: to be honest with help from a generic forum, you're unlikely to get this fixed: you either need help of people who're used to deal with this exact software package and/or somebody with hands-on access.