PHP Open Chat Tutorial and Installation How To
-
Mini-Me
- $6.95 /month
- 5 GB Storage
- 1 FTP Account
- 25 Subdomains
- 15 GB Bandwidth
- 50 E-mail Boxes
- 25 MySQL DBs
This tutorial describes how to use the PHP Open Chat chat software with your NEXCESS.NET web hosting account. NEXCESS.NET specializes in hosting PHP Open Chat software and this tutorial is meant to help you quickly setup your site with our web hosting service.
PHP Open Chat is open source, meaning that you can use and distribute it as you'd like as long as you don't change it.
For the sake of this tutorial we'll assume that you own the domain 'johnsmith.com' and are setting up PHP Open Chat at http://johnsmith.com/phpoc/.
Follow these steps to complete the tutorial:
- The first thing to do is to run through
the SiteWorx MySQL tutorial and
create a database for PHP Open Chat to use to store the information
it needs.
Create a database called 'phpoc' with a user named 'phpoc'. When you do this SiteWorx will prefix the database and user names with some text resembling your domain name.
With our example domain of 'johnsmith.com' the database name is 'johnsmit_phpoc' and the username is the same 'johnsmit_phpoc'. You also need to import the 'db.schema' file in order to setup the tables. You can do this using the phpMyAdmin system. If you don't know how to do this, check out the phpMyAdmin tutorial on our tutorials page. - Download the latest version of PHP Open
Chat from the PHP
Open Chat website and unzip the contents of the zip file to your
desktop using http://winzip.com.
You should now have a folder which contains all the files and folders you need to install and run PHP Open Chat. Rename the 'phpopenchat-3.0.0b8' folder to 'phpoc'. You need to edit some files to change their settings. Open the 'config.inc.php' file. Scroll down the to section that starts with the line '* database account settings'. Here you need to enter the information for the database you created in step #1. For this example, we will change the information as follows:
- define('DATABASE_HOST', 'localhost');
- define('DATABASE_USER', 'johnsmit_phpoc');
- define('DATABASE_PASSWORD', 'mypassword');
- define('DATABASE_TABLESPACE', 'johnsmit_phpoc');
Your screen should look like this:
You can change the other settings in this file if you'd like. For this example, we'll leave them set as the default values. Save and close the 'config.inc.php' file.
- Upload the 'phpoc' folder to your web hosting account. You can do this using an FTP program. If you don't know how to do this, check out the FTP tutorial on our tutorials page. Once the PHP Open Chat files and folders are finished uploading you can run the 'test.php' file to make sure your server can handle running PHP Open Chat.
- In order to run the tests on the server,
you can access the 'test.php' file by pointing to 'http://www.johnsmith.com/phpoc/test.php'.
The script will check your database and tables. The script will also check to make sure the folders where you need to upload files are writable. Your database tests should pass but the folder checks will fail. You haven't made these folders writable yet. If you receive any errors on your database, make sure you entered the correct values in the 'config.inc.php' file in the database section. Your screen should look like this:

You need to change the permissions on the 'tmp' folder and the 'include/templates/openchat/images/icons/chatter' folder in order for the script to write to them. You can do this using the CHMOD command in your FTP program. If you don't know how to do this, check out the FTP tutorial on our tutorials page. You need to CHMOD these folders to 777.
Once you've changed the permissions, refresh the 'test.php' page. All the tests should pass now. Your screen should look like this:

- Click the 'login' link to continue. You
should receive a popup window asking you to delete or rename the
'install.php' file for security purposes. Your screen should look
like this:

Delete this file from your webspace. Click on the 'OK' button. You should now be on the login page of the chat room. Your screen should look like this:

The username and password fields should be filled in for you already. You will see the username and the password for the admin account listed below. Make note of these values. You can now click the 'Go' button to login. You should now be logged into your chat as the admin. From here you can manage your chatroom as you see fit. The PHP Open Chat tutorial is now complete. Your screen should look like this:
For more information on how to use PHP Open Chat once it's installed, check out the PHP Open Chat Forum.