0

I have installed a version of Cometchat Nulled on my web site. I got this messages in my chatrooms window. Besides, I don't use any CMS, my pages are HTML files.

Image:

Click here to see messages

halfer
  • 19,824
  • 17
  • 99
  • 186
Micheal
  • 89
  • 1
  • 1
  • 5
  • 2
    Your question title and the problem in your screenshot seem to be different. Are you getting both problems: a database connection error and a modify headers warning? – halfer Nov 04 '16 at 11:12
  • The "headers already sent" is a consequence of your not having turned off your on-screen warnings, the [canonical duplicate is here](https://stackoverflow.com/questions/8028957/how-to-fix-headers-already-sent-error-in-php). If you have access to your `php.ini` you can turn this off using the `display_errors` directive. It can often be turned off in `.htaccess` files too, for people on shared hosting. – halfer Nov 04 '16 at 11:14
  • Where do you see the connection error? It is not in your screenshot. – halfer Nov 04 '16 at 11:20
  • Yh, right maybe it's not database connection, any way, i don't have a .php file, and this is my .htaccess file: http://prntscr.com/d338ks what should i change there? – Micheal Nov 04 '16 at 17:51
  • Alright, before we can get a solution we need to establish what you have. As far as I can tell you _do_ have PHP files - they are explicitly identified in your screenshot. One of them is called `cometchat_init.php` and the other is called `cometchat_guests.php`. I take it this is your own installation, which you have FTPed onto a server? – halfer Nov 04 '16 at 21:35
  • For your `.htaccess` file, I am guessing you could add `php_flag display_errors off`. This is what I would try, in absence of knowing what sort of hosting you have, and how it is configured. If this does not work e.g. it results in a 500 Server Error, contact your host to ask how to reset this flag. – halfer Nov 04 '16 at 21:40
  • (In general I do not respond to emails asking for please-do-it-for-me, since we want to encourage people to learn for themselves. Nevertheless on this occasion, since it was a quick fix, I have resolved the problem on your server). – halfer Nov 04 '16 at 23:07
  • Also, very important: (1) it is not a good idea to send your cPanel and database credentials to someone you do not trust; (2) you should not trust me or anyone on the internet unless you have good reason to do so; (3) if you use cPanel then at least use the SSL version on port 2083, so your password cannot be sniffed by third parties. **Please change your cPanel password now** and stop using port 2082. – halfer Nov 04 '16 at 23:10
  • Thanks halfer, first, i don't have any thing to lose in my cpanel, then im not a programmer, so don't need to learn every thing, and what did you fix??? i don't see any changes still same warnings and messages, and when i go to the cometchat admin and change guest to enable, still says please login to use chat :( – Micheal Nov 05 '16 at 16:08
  • If you are not expecting to see a login prompt then you'll need to consult the documentation. That looks like a deliberate situation on the part of the developer, and probably needs configuring in some way, if that is not what you want. – halfer Nov 05 '16 at 17:45

1 Answers1

0

As I indicated in the comments, your chat script is outputting a warning because:

  • there is a problem it wants you to know about
  • PHP's settings in your installation (specifically display_errors) require it to render the issue on-screen

This warning is telling you that this script is using an old database library. It is possible there is a setting to swap to a newer database library such as PDO - please do look into it. Presently you cannot use PHP7 at all because of this problem, even though your host offers it.

The solution here was to edit this configuration setting in your config.php:

define('DEV_MODE','0');    // Set to 1 only during development

I swapped the 1 to a 0 and this must have reset the display_errors setting for us within the script itself.

halfer
  • 19,824
  • 17
  • 99
  • 186
  • i tried the DEV_MOD, didn't work, and i didn't get what else you said, because i don't know much – Micheal Nov 05 '16 at 16:06
  • @Micheal: it did work, and it still works, [see here](http://www.autofxpower.com/cometchat/index.html) - warnings all gone in the "Chatrooms" pop-up panel. `DEV_MODE`, not `DEV_MOD`. Is there another Comet Chat installation somewhere? What link are you looking at? – halfer Nov 05 '16 at 17:42
  • 1
    I was checking it on my home page, there aren't errors now, thank you. – Micheal Nov 05 '16 at 17:51
  • You know the problem is when i go to admin panel, and exit, the errors come back again – Micheal Nov 05 '16 at 18:08
  • @Micheal: you'll need to be more specific than that. What admin panel? Where do the errors manifest themselves, at what URL? – halfer Nov 05 '16 at 18:12