Mazen's PHP Chat Documentation | ||
---|---|---|
Prev |
To run the Chat on a Linux-System, you need to recompile your PHP4 distribution with some special flags. Get the latest PHP Build (currently PHP-4.1.0RC5 which soon will be final hopefully) from http://www.php.net/~zeev/php-4.1.0RC5.tar.gz and unzip it to a directory of your Choice. From there, run ./configure --with-apxs=/path/to/your/apxs --enable-sockets (You can add your own flags there). After the configure command finished, run make ; make install, restart your Apache, and take a look if the Socket-Extensions have been enabled for your PHP-Build.
Now, do the same as above but change the ./configure to the following: ./configure --enable-sockets --enable-pcntl. After that, run make ; make install again (you don't need to restart your webserver). This will build the CGI-Version of php4, which can be used from the command-line. Try to execute /usr/local/bin/php -v. If the Output is 4.1.0RC5, everything is ok, and you can continue installing the Chatserver.
Get the latest Chat distribuion from http://www.mazenphp.de and unzip it into a directory inside your Webserver-Root directory. Open up the configuration.inc.php with a text-editor and set the following Variables.
Variables:
Your Database Host ( mostly localhost)
The Username for the Database
The Password for the Database
The Name of the Database
The absoulte Path to the Chat. This can not start with http:// and can not be /chat. It is the complete Path beginning on the server's root directory "/" to the Chat-Distribution. Don't add a final / to this line.
Open up a console to your server, and change into the Chat-Directory. There is a file called chat3.sql, which contains the whole Database shema. Import it by using: mysql -u [database_user] [database_name] < chat3.sql -p. Enter your Password, and the Database schema should have been successfully imported.
Open up a Webbrowser and point it to the point, where you installed the Chat. Append /admin/ to the URL. From there, you can login with the user "root" with the password "admin". After Logging in you should see an overview of the Chat. Click on "Configuration". Edit all appropriate fields in there and save your changes. The fields aren't described here because you can find Help-Texts within there.
Open up a console again if you are ready with all the configuration. Change into the chat-directory and from there into the "server"-subdirectory. If you decided to use logfiles, create a Directory called "logs" ( mkdir logs ), and give it write-rights ( chmod 777 logs ). Then, run /usr/local/bin/php server.php --debug. If no error message is thrown, you can try to log into the Chat with the user "root" with the password "admin". If you see the Welcome message and everything else seems to look ok, you've done everything right ;). But there's still a console open, which you surely don't want to use. So, logoff from the chat (close your browser window). And in the Console where the Chatserver is running, type Control+C to kill the Chatserver. After that, run: /usr/local/bin/php server.php --daemon. This will run the Chatserver in daemon mode, and you can safely log off from the console. Now, everything is set up alright, and you can start chatting.