» Documentation


Big thanks goes out to Sander "Nakebod" Rutten from The Netherlands for making this awsome documentation

Installing phpBNC on Linux

To run phpbnc, there are 3 things you need.
  1. phpBNC itself
  2. MySQL Database
  3. ionCube loaders
This manual will describe all these steps, but it won't cover the installation of the MySQL server.
For a manual MySQL installation, visit the MySQL Homepage, or check the website of your Linux distribution.
Most Linux distribution's provide pre-compiled packages via a package manager. The MySQL package is mostlikely one of them.

1. phpBNC

Download the latest version of phpbnc from the Download page. The current version is 0.18-beta.
$ mkdir phpbnc
$ cd phpbnc
$ wget http://www.phpbnc.se/files/phpbnc-0.18-beta.zip
$ unzip phpbnc-0.18-beta.zip

What did you just do?
With mkdir, you created a new directory (make dir).
With cd phpbnc, you entered the newly created directory.
With wget http..., you have just downloaded phpbnc-0.18-beta.zip.
With unzip, you have unpacked the archive.

You can now view the content of the extraced zip file.
$ ls
changelog.txt host.pem main.php phpbnc.sql trail config.php license.txt phpbnc-0.17-beta.zip readme.txt

2. MySQL Database

The easiest way is to use a tool like phpMyAdmin.
If you don't have such a tool available, you need to use the command line options.

phpMyAdmin

Go to the URL where your phpMyAdmin is located, most likely http://your_ip/phpMyAdmin/, and login with an user which has enough access rights to create a new database. Mostly this is the user: root.
After you are logged in, click on Import.
Now, browse for the phpbnc.sql file, located on your computer. After you have found this file, click on the button Go.

Import has been successfully finished, 11 queries executed.

The database is now created, and ready to use.
I really suggest to create a different user for the phpbnc database, instead of running it with root priveleges.

To add a user, click at phpMyAdmin's main page on Privileges and the click on Add a new User.
Fill in a username.
Select Localhost as Host, unless you run phpbnc and the database on seperate servers.
Type in a password and repeat it.
Click on the button Go to create this user.

You have added a new user.

SQL query:
CREATE USER 'phpbnc'@'localhost' IDENTIFIED BY '***********';

GRANT USAGE ON * . * TO 'phpbnc'@'localhost' IDENTIFIED BY '***********' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0 ;

We have created a user, but this user does only have global rights, so it can't store data in the database.
Scroll down a little bit, untill you see Database-specific privileges Select the phpbnc database, and the page is automatically reloaded, and you can set the priveleges.
Click on Check All and after that on the button Go
You have updated the privileges for 'phpbnc'@'localhost'.

SQL query: GRANT ALL PRIVILEGES ON `phpbnc` . * TO 'phpbnc'@'localhost' WITH GRANT OPTION ;
The user phpbnc has now full control over the database phpbnc.
We can now go to ionCube loaders.

MySQL Command line interface (CLI)

In this example, we login as the user root, with a password. If you use a MySQL server without password (Which is very insecure!) you don't need the -p commandline switch.
$ mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 39
Server version: 5.0.45-Debian_1ubuntu3.2-log Debian etch distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>

We are now logged in to the MySQL command line interface, with success.
If you tried to login without a password, and the account needed a password, you will receive an error:
$ mysql -uroot
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

Right now, we have to create the phpbnc database.
Maybe you have mentioned the file: phpbnc.sql already. This is the complete database.
With this file, a database with the name phpbnc is created, and all the tables and some default data is inserted to the phpbnc database.
We are still connected to the MySQL command line interface, and we are ready to create the database.
mysql> source phpbnc.sql;

Query OK, 1 row affected (0.01 sec)

Database changed
Query OK, 0 rows affected (0.02 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.01 sec)

Query OK, 1 row affected (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

Query OK, 0 rows affected (0.01 sec)

mysql>

We can now check if the database is created:
mysql> SHOW DATABASES;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| phpbnc             |
+--------------------+
3 rows in set (0.00 sec)

mysql>

You can now use the command quit to exit the MySQL command line interface.

3. ionCube-loaders

To run phpbnc, we need ionCube loaders.
Download the correct version for your OS.
In this example, it is the version for Linux (x86), packaged in tar.gz format.
$ wget http://downloads2.ioncube.com/loader_downloads/ioncube_loaders_lin_x86.tar.gz
$ tar xfz ioncube_loaders_lin_x86.tar.gz
$ ls
changelog.txt config.php host.pem ioncube ioncube_loaders_lin_x86.tar.gz license.txt main.php phpbnc-0.17-beta.zip phpbnc.sql readme.txt trail

So, after unpacking ioncube_loaders_lin_x86.tar.gz we have a new directory: ioncube. In this directory you can find different versions of the ionCube loader.
You just need 1 of them, depending on your running php version.

$ cd ioncube
$ ls
ioncube-encoded-file.php ioncube_loader_lin_4.2.so ioncube_loader_lin_4.4.so ioncube_loader_lin_5.0_ts.so ioncube_loader_lin_5.2.so README.txt
ioncube-loader-helper.php ioncube_loader_lin_4.3.so ioncube_loader_lin_4.4_ts.so ioncube_loader_lin_5.1.so ioncube_loader_lin_5.2_ts.so
ioncube_loader_lin_4.1.so ioncube_loader_lin_4.3_ts.so ioncube_loader_lin_5.0.so ioncube_loader_lin_5.1_ts.so LICENSE.txt
$ php -v
PHP 5.2.3-1ubuntu6.3 (cli) (built: Jan 10 2008 09:38:41)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
$ cd ..

It is possible that you have to edit your PHP configuration, php.ini, to load the ionCube loaders.
How you can do this, is described at the ionCube website.
Index:
[+] installing
-windows
-linux/freebsd
-configuration
-ssl certificate

[+] running
-starting the software
-logging in for the first time
-different ways of logging in
-updating users settings

[+] commands
-bconnect
-breconnect
-bquit
-brestore
-bclear
-readlog
-dellog
-pb set
-pb list
-pb del
-pb myinfo
-pb uptime

-pb aset
-pb stats
-pb kick
-pb banchan
-pb unbanchan
-pb find
-pb check
-pb info
-pb ban
-pb unban
-pb addhost
-pb delhost
-pb allmsg
-pb trail
-pb untrail
-pb admin
-pb adduser
-pb deluser

© 2007-2010 phpBNC.se