How To Setup a Fake IRC Server with phpFreeChat

Feb. 25th, 2009 By Jason K

setup irc serverInternet Relay Chat. One of the early forms of communication on the Internet, IRC featured a very basic chat protocol. While Tim has explored creating an individual IRC channel, we’ll be creating a fake IRC server using phpFreeChat, which allows you to create separate “channels” and various other features reminiscent of IRC (though certainly not as advanced). You’ll need a web server with PHP.

Installing phpFreeChat

  • Grab the latest phpfreechat-x.x-setup.php at Sourceforge (1.2 is the latest version at the time of this writing).
  • Upload it or move it to a local web server directory. We’re going to be using a XAMPP installation, so we’ve moved it to the root directory. You don’t want to put the install file where you want the chat to be.
  • Navigate to the file. Our URL would be http://localhost/phpfreechat-1.2-setup.php. You’ll be greeted with a Pre-Install Check. Hopefully it looks like the picture below. Hit ‘Next’.
  • install chat room

  • You’ll be prompted for an install path. By default it creates a phpfreechat directory in the current directory, but you can change it to whatever you wish. Hit ‘Next’.
  • Path of Installation

  • It’ll ask you to confirm the install. Click ‘Next’. Watch the pretty progress bar. Once it’s finished, click ‘Next’.
  • It’ll have installed itself in the directory of your choice, ours being http://localhost/phpfreechat/. Do as it says and delete the phpfreechat-x.x-setup.php file.

Quick Configuration

Setting up the Admin Account

The equivalent of an IRC channel op, the admin password allows you to gain access to privileges such as kicking, banning, and viewing user IP addresses. Admin status is global across all channels.

  • Open up index.php in the installation directory. Add the following line (before: $chat =…)

    $params['admins'] = array(’username‘ => ‘password‘);

    Replace username with the desired username, and password with the desired password.

  • Remove the following line:

    $params["isadmin"] = true; // do not use it on production servers ;)

  • Save the file. Head to the chat room, and type /rehash
  • Change your nickname to the username specified in step 1 by typing /nick username
  • Type /identify password where password is the password you specified in step 1 – If all goes well you should be identified.
  • Prompt for Nickname Upon Entry

    By default, the chat assigns you a nickname guest followed by random numbers. To force the user to choose a nickname when they enter:

  • Remove the following line from index.php:

    $params["nick"] = “guest”.rand(1,1000); // setup the intitial nickname

    Save the file.

  • Rehash the chat with /rehash – make sure you’re logged in as admin, indicated by the shield icon next to your name.
  • Remove Censor and Flood Protection

  • Add the following line to index.php:

    $params['skip_proxies'] = array(’noflood’,'censor’);

    Save and rehash the chat.

    Final Notes

    add chat room to your site

    Important Commands

    • /nick username – Change your username to username
    • /identify password – Gives you admin rights, given the right username and password.
    • /op username - Gives username admin rights.
    • /kick username reason – Kicks a username with a given reason.
    • /join room – Joins room “room”. If it doesn’t exist, it’s created.
    • /help - Your best friend.

    The Basics

    • A list of the rooms you’re currently in is shown as tabs at the top of the chat, click to switch rooms (equivalent of IRC channels). You can create new ones using the aforementioned /join command.
    • You can view the IP address and an option to private message a user by clicking on their name in the list.
    • Explore around. You can find phpFreeChat documentation on their website.

    Do you prefer to use any other IRC-type chat software for your website? If so, recommend it to us in the comments. Or if you have any problems setting this up, leave a question and we will try to help you.

  • (By) Jason K is a student who enjoys video games and wasting time. He writes at his own weblog, Third Error.

    Enjoyed the article? Subscribe to MakeUseOf to get daily updates on new cool websites and programs in your email for free. You'll also get free printable cheat sheets to your favorite programs

    Your Email:

    Add MakeUseOf to:



    23 Comments Add Comment
    2009-02-25 23:10:27
    Subscribed to comments via email

    i know this is kindof offtopic, but what firefox theme is that?

    2009-02-26 02:27:24

    Default Firefox theme on XP. I use Hide Menubar to hide the top menu bar.

    2009-02-26 13:57:04
    alfred

    I like that makeuseof.com is getting a little bit more technical :)

    2009-03-04 05:13:19

    Didn’t worked … After the Install Step It says ” failed to create directory ” and Exits ..

    2009-03-04 20:02:49

    Does the directory already exist? It has to be a new directory.

    2009-04-05 03:40:19

    I have just made a admin params.
    But when i try insert /identify mypassword ( mypassword is my password :D ) Then every time me writed : Identification faliure.

    2009-04-06 17:58:53

    What’s the exact line for your admin and password from the config? Make sure you’re typing whatever is in quotes exactly.

    2009-08-11 03:51:25
    Lisa
    Subscribed to comments via email

    I get the same failure. I copied and pasted your line of code and just replaced with my own name and password. No matter what I try, I get a failure.

    (Comments wont nest below this level)
    2009-08-26 12:59:16
    Glix

    Use the correct quotes :P
    $params['admins'] = array(”username” => “password”);

    2009-04-06 11:53:51
    Subscribed to comments via email

    Does the directory already exist? It has to be a new directory

    2009-04-13 15:10:08
    Hector

    Hi im having the next problem

    Adding directory: / ……………………………………….[failed]
    >> Failed: could not make directory / Exiting…

    the directory path does not exist though it stills giving me this error, any solution?

    2009-05-23 05:09:42
    Subscribed to comments via email

    make sure your install path is right, do not use the original path ,you see the pic http://www.makeuseof.com/wp-content/uploads/2009/02/install_2b.png the path is E:xmpp/**/** chang it by yourself

    2009-04-24 21:34:13

    i like this chat , ubuntu?!

    2009-05-04 03:14:05
    Kelly

    Why remove flood protection? Doesn’t it exist to prevent users from flooding with malicious scripts?

    Does keeping flood protection also prevent the admin from running macros? And on that topic, does this chat program support macros like IRC does?

    2009-05-23 16:44:19

    Im going to use phpfreechat but i find it hard to install :(

    2009-06-02 20:43:46

    yeah … it’s hard to install

    2009-06-02 22:01:26

    At what point is it hard to install?

    If phpfreechat doesn’t quite fit the bill, you can always try various other chat applications.

    2009-06-08 14:25:48
    elgee
    Subscribed to comments via email

    Hi,

    I have a question about this app. By fake IRC server, do you mean, it is similar to an IRC server, but is not one? And would I be able to run an existing IRC bot against this server, in that case?

    Thanks,
    elgee

    2009-06-08 20:22:26

    Yes, it is similar to an IRC server but it is not one. So, no, you would not be able to run an existing IRC bot.

    2009-06-08 21:34:06
    elgee
    Subscribed to comments via email

    Oh ok, thanks for the clarification :)

    elgee

    2009-07-22 22:55:06
    Dean
    Subscribed to comments via email

    I am trying to link my PHPFreeChat to our Mysql Database to ensure that only registered users can use out chatroom. HELP!

    ALL I want to do is to link to our SMF User database.

    CODE:

    Truckin’ Bozo’s Chat!

    NOTE:
    If you are inactive for five minutes you will be auomatically logged off. To log back on, in the command line type:

    /connect YOURUSERNAME

    SPONSORS

    The People’s Journal

    SS Travel Corporation

    Help Section

    Useful Links

    printChat(); ?>

    2009-07-22 22:58:03
    Dean
    Subscribed to comments via email

    I Tried to put my code in the post. Please refer to the link to see the code.

    Click Here

    Thanks

    2009-09-28 09:40:35
    mohamed maher
    Subscribed to comments via email

    plz help i uploaded the setup file but when i go to the url there is a white page

    Reply

    You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> in your comment.