Frequently Asked Questions (FAQ)

Why does phpFreeChat not work using Free.fr internet provider ?

The chat uses sessions. To make sessions work with Free.f,r users should create a folder named sessions on the root of their site.

Use the ftp command mkdir sessions to create the folder.

My filesystem is slow, how can I improve performance ? (for Linux users)

For windows users, have a look to this link or this link.

By default, the chat data (messages and nicknames) are stored into phpfreechat/data/private/chat/ but this path is customizable.

On linux it exists an interesting feature which will improve drastically the filesystem performances, this is tmpfs. In fact, it is a memory based filesystem, the read/write access will be very fast but your data will be lost on the next reboot.

On my Linux box (debian, kernel-2.6.x), a default tmpfs filesystem is mounted on /dev/shm so I suggest to configure phpfreechat to store chat data into this directory. To do that, just add this parameter :

$params["serverid"] = md5(__FILE__);
$params["data_private_path"] = "/dev/shm/mychat";
$chat = new phpFreeChat($params);
[...]

For your information, I did a benchmark test :

Without tmpfs (HD) :
  • 10000 writes = 9.07 sec (82.49%)
  • 10000 reads = 0.38 sec (3.49%)
  • 10000 removes = 0.31 sec (2.84%)
With tmpfs (RAM) :
  • 10000 writes = 0.70 sec (6.37%)
  • 10000 reads = 0.40 sec (3.64%)
  • 10000 removes = 0.12 sec (1.16%)

How to create multiple channels (rooms) ? (only for 0.x branche)

By default, the channel parameter is auto-generated (based on the title parameter), but it's possible to specify it in order to create totaly independants channels.

To handle multiple independant channels into one script passing the channel name by URL, just configure the chat like this :

$params["serverid"] = md5(__FILE__);
$params["channel"] = $_GET["channel"];
$chat = new phpFreeChat($params);
[...]

When browsing the script, for exemple http://.../mychat.php?channel=myroom, a totaly private chat will be created and data will be stored into phpfreechat/data/private/chat/myroom/.

How to rehash the chat ? (only for 1.x branche)

Rehash is needed when you change a value in your parameter list. If you don't rehash the chat, the old value will be used because the chat uses a cache.

To rehash the chat, you just have to run:

/rehash

However, you must be admin to run this command. To identify yourself as an admin, by default (if you didn't change the admin password) you just have to run these commands:

/nick admin
/identify

(by default, the admin user don't have any password, but you can change it)

How to change the chat admin password ? (only for 1.x branche)

Administrators (user/password) are defined in the admins parameter array.

Example: suppose I want to make bob and boby admins with bob1 and boby1 as paswords. I just have to add this parameter:

$params['admins'] = array('bob'  => 'bob1',
                          'boby' => 'boby1');

(don't forget to rehash your chat)