Dear friends,

I've just installed the phpfreechat module, but I can't activate it, or I get the following error:

Please correct these errors:

    * 'serverid' parameter is mandatory by default use 'md5(__FILE__)' value

I am using Drupal 5.1 - if anyone can help, it would be most appreciated.

Comments

farnsworth’s picture

I have the same error now clue yet but i will post back if i figure it out.

jasonyoung’s picture

I'm also having the same issue. I partially fixed it by adding the base_url option under settings.php. However, I discovered that if I tried to go to the https: version of my site I would get the same error.

jasonyoung’s picture

I was able to get around the https issue by placing the full http url in the menu entry I created for phpfreechat.

ray007’s picture

I had, the same problem, setting $param['serverid'] in handler.php fixed it.

Now I'm having other issues - maybe phpfreechat 1.0 beta 10 does have some problems ...

harrisou’s picture

Ray-- can you be a little more explicit on how you fixed the error?

From your comment, I dont see:

$param['serverid']

From the code:

// $Id:

  if (!$_GET['q']) $params = $_GET; // Only need to fetch query string after initial request
  // Explode channels into an array of strings
  $params['channels'] = explode(',', $params['channels']);
  // $params['frozen_channels'] = explode(',', $params['frozen_channels']);
  require_once dirname(__FILE__)."/phpfreechat/src/phpfreechat.class.php";
  // print_r($params); // Debug (will break xml-rpc)
  $chat = new phpFreeChat($params);

What did you exactly change? Thanks in advance!

ray007’s picture

After the line $params['channels'] = explode(',', $params['channels']);
I inserted a line

$params['serverid'] = md5(__FILE__);

next I had to update the permissions of the data-directory, so the module can write in there.

and now the chat starts fine, but there seems to be a problem with the timeout mechnism, and firebug shows me hundreds of concurrent xajax calls - so I assume something with the parameters goes very wrong, since the timeout value is also a parameter ...

Maybe I'll find some time for more debugging tomorrow.

ray007’s picture

The beta-9 works a little bit better than beta-10, at least I did manage to send a few messages.
When setting refresh_delay and timeout myself in the settings, phpfreechat complained that those parameters need to be positive numbers - which is strange since I set the same values that are default.
One problem I had with both versions of phpfreechat, is that the smiley-icons didn't show properly but were html-escaped strings.

Currently something in phpfreechat complains about an unknows function pxlog() on the javascript side, so far I haven't really managed to get it all working embedded in the drupal site.

Calling http://my.site.com/sites/all/modules/phpfreechat/phpfreechat/ works fine.

I'd appreciate any help in getting this running.

hectorplus’s picture

Getting the same error.

idej’s picture

Same problem: servid should be set to md5(_FILE_). Using 5.x Drupal
- has there been a patch for this yet?

idej’s picture

I believe I have a fix for this problem. Go to the pfcglobalconfig.class.php file in sites/all/modules/phpfreechat/phpfreechat/src/. This is where the serverid is set - clearly it has not been set in the params["serverid"] array so set it needs to be set manually as follows:

// check the serverid is really defined
if (!isset($params["serverid"])){
//$this->errors[] = _pfc("'%s' parameter is mandatory -- so using default: '%s' value", "serverid", "md5(__FILE__)");
$params["serverid"]= md5(__FILE__);
$this->serverid =$params["serverid"];
}
else
$this->serverid = $params["serverid"];

The above is a code fragment that replaces the equivalent lines in the file. You then need to go to each content type and enable it for chat as required. I have noticed that it all works very well with IE 6 but Firefox (latest) seems to have a number of issues that need fixing e.g. excessive ajax posts from the xajax.js script ; BOLD is not working properly for chat data and a flickering logo on hover. The latter need some more investigation. In IE the results are great and many thanks to those who developed this code.

ray007’s picture

I think if possible we should try to avoid changing phpfreechat code itself and keep the changes to the module.
I have noticed the excessive ajax call in firefox, but they don't happen when I call phpfreechat directly, and not through the module, so ...

And your findings seem to point to the same conclusion: we have a problem getting the parameters set in the module to the phpfreechat script.

idej’s picture

I agree entirely - but I tried your change to the handler.php file with no success - this made me look lower down the stack.
The ajax calls in firefox seem to be debug and it should be possible to stop them. I need to try this however. The odd thing is that I do not see this in IE.

idej’s picture

Investigating the AJAX posts reveals that both IE and Firefox behave the same - you can use MS Fiddler to see the calls in IE. The posts are in fact a design feature and not a bug - they are a "ping" that keeps alive the connection between the client and server and makes sure the server is still running - indeed the elapsed time for the ping is displayed in the chat box with a css class called pfc_ping. What would be good would be to reduce their frequency which seems too high. I don't think the rate will scale with many clients pumping out HTTP posts to the server. I have not found out how to lower the rate yet.

Owen Barton’s picture

@idej - there is a parameter (on the settings page) to control the rate. The server should be able to withstand a high number of these because the amount of php loaded and run for each request is very small, as is the request and the response in terms of Kb.

owahab’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.