Posts: 11
Threads: 4
Joined: Jan 2021
Hi there,
Thanks for this terrific resource! I followed instructions as best I could for installation and integration, but am seeing nothing yet on my pages where I have tried to add comments.
Here is a test page I made:
http://imaginesonomacounty.com/test.html
I'm not sure where I went wrong -- installation or database creation or integration steps? Installation seemed to go smoothly.
Any help or tips would be appreciated - thanks!
Posts: 2,834
Threads: 57
Joined: Jun 2010
Hello,
If you view the source code of your page you can see the PHP code. This may be because you're integrating into a HTML file and you haven't instructed your server to treat any PHP code found in HTML files as PHP, so it doesn't know what to do with it.
See this FAQ for more info:
https://www.commentics.org/faq/php-integ...html-files
Also I noticed that in your integration code you've put "/comment/" but you've installed it at "/comments/" with an "s" at the end. Also don't forget to delete the install folder.
Have
you completed
the interview?
Posts: 11
Threads: 4
Joined: Jan 2021
Thanks, this helped me get part way there. I fixed the /comments/ line and made sure install folder was deleted.
I tried renaming as a .php file and everything immediately worked perfectly.
However, when I tried adding the two sample lines below into the .htaccess file (first tried one, then the other), I still get nothing in my .html test.
AddHandler application/x-httpd-php5 .html .htm .shtml
AddHandler x-httpd-php5-cgi .html .htm .shtml
Here's how my .htaccess file reads now:
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php72” package as the default “PHP” programming language.
<IfModule mime_module>
AddHandler application/x-httpd-ea-php72 .php .php7 .phtml
AddHandler x-httpd-php5-cgi .html .htm .shtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
Are there any other tricks I should try or am I just going to need to use .php for any pages with comments?
Thank you!
Posts: 11
Threads: 4
Joined: Jan 2021
And to follow up on my message above...
I have now tested switching to .php on a page from my actual website and although the comment form appears to work, I do not see the comments showing below.
The test version works fine:
http://imaginesonomacounty.com/test.php
But this version does not yet show the comments:
http://imaginesonomacounty.com/solutions...stuff1.php
Also every time I answer the security question the first time it tells me I have the wrong answer and then it lets me through on the second question.
Posts: 2,834
Threads: 57
Joined: Jun 2010
Okay I see. Remove any changes you made to your .htaccess file, then do this:
Change this:
Code:
AddHandler application/x-httpd-ea-php72 .php .php7 .phtml
To this:
Code:
AddHandler application/x-httpd-ea-php72 .php .php7 .phtml .html
Have
you completed
the interview?
Posts: 2,834
Threads: 57
Joined: Jun 2010
The reason the comments aren't showing is because your website's own stylesheet,
http://imaginesonomacounty.com/imagine.css, has this:
Code:
section {
position: fixed;
left: 50%;
margin-right: -50%;
transform: translate(-50%, -50%);
}
Try adding the following just below it:
Code:
.cmtx_container section {
position: static;
left: auto;
margin-right: 0;
transform: none;
}
Have
you completed
the interview?
Posts: 2,834
Threads: 57
Joined: Jun 2010
In your integration code try changing this:
To this:
PHP Code:
$session_parameters = [
'cookie_httponly' => 1,
'use_only_cookies' => 1,
'use_trans_sid' => 0,
'gc_maxlifetime' => 1440,
'cookie_lifetime' => 0,
'cookie_path' => '/; SameSite=Lax',
'cookie_secure' => 0
];
session_start($session_parameters);
(That's a fix for having to answer the security question twice)
Have
you completed
the interview?
Posts: 11
Threads: 4
Joined: Jan 2021
I made the .htaccess file change you suggest and the .html test page (
http://imaginesonomacounty.com/test.html) still is not working.
.htaccess file now reads:
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php72” package as the default “PHP” programming language.
<IfModule mime_module>
AddHandler application/x-httpd-ea-php72 .php .php7 .phtml .html
AddHandler x-httpd-php5-cgi .html .htm .shtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
The stylesheet change did not fix the disappearing comments problem, but I did try an alternate stylesheet where I removed the code you mentioned and it worked fine after that -- so I might be able to get by with simply using an alternate stylesheet for pages with comments.
As for the double security questions, I now realize I can disable the questions... so I will just do that rather than add code.
Thanks again for your help and great resource you offer.
Posts: 2,834
Threads: 57
Joined: Jun 2010
You might need to remove this line for it to work:
Code:
AddHandler x-httpd-php5-cgi .html .htm .shtml
Okay well if you find time at some point it'd be great to know if the solution for the security question works because I think a few other people have experienced the same thing.
Have
you completed
the interview?
Posts: 11
Threads: 4
Joined: Jan 2021
Thanks.
Success: removing the line from .htaccess file that you suggested removing did work. Now it is working with .html files.
I will also try to test the security question fix soon to let you know if it works.