Home arrow PHP arrow Page 3 - Talking The Talk (A phpBB Primer)

Building Blocks - PHP

Looking for a full-featured message board to add interactivity to your site, or to communicate with your customers or users? Look no further than phpBB, a robust, open-source PHP implementation that is both easy to use and simple to administer. This introductory tutorial discusses the process of installing, configuring and using phpBB, explaining how to create discussion forums, add users, assign moderators and administrators, and post and search for messages.

TABLE OF CONTENTS:
  1. Talking The Talk (A phpBB Primer)
  2. The Big Picture
  3. Building Blocks
  4. Starting Up
  5. An Open Forum
  6. A Moderate Approach
  7. The User Experience
  8. Doing More
  9. Link Out
By: icarus, (c) Melonfire
Rating: starstarstarstarstar / 12
June 13, 2003

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

In order to get started with phpBB, you'll need a working PHP installation (I'm currently running PHP 4.2.3), a MySQL database server (I'm running MySQL 4.0.10) and a copy of the latest release (currently version 2.0.4) of the package; you can download a copy from http://www.phpbb.com/downloads.php

Setting up the package is pretty simple. The first step is to uncompress the source archive into a directory under your Web server (mine is called "medusa" here) root.


$ cd /usr/local/apache/htdocs/

$ tar -xzvf /tmp/phpBB-2.0.4.tar.gz

This should create a directory (named "phpBB2/" for phpBB 2.0.4) which contains the following files:


$ ls -l /usr/local/apache/htdocs/phpBB2
drwxrwxr-x 2 www www 4096 Jan 15 19:04 admin
-rw-rw-r-- 1 www www 5489 Jan 15 19:04 common.php
-rw-rw-r-- 1 www www 0 Jan 15 19:04 config.php
drwxrwxr-x 2 www www 4096 Jan 15 19:04 contrib
drwxrwxr-x 2 www www 4096 Jan 15 19:04 db
drwxrwxr-x 2 www www 4096 Jan 15 19:04 docs
-rw-rw-r-- 1 www www 810 Jan 15 19:04 extension.inc
-rw-rw-r-- 1 www www 3596 Jan 15 19:04 faq.php
-rw-rw-r-- 1 www www 46523 Jan 15 19:04 groupcp.php
drwxrwxr-x 3 www www 4096 Jan 15 06:17 images
drwxrwxr-x 2 www www 4096 Jan 15 19:04 includes
-rw-rw-r-- 1 www www 14332 Jan 15 19:04 index.php
drwxrwxr-x 3 www www 4096 Jan 15 19:04 install
drwxrwxr-x 3 www www 4096 Jan 15 19:04 language
-rw-rw-r-- 1 www www 7097 Jan 15 19:04 login.php
-rw-rw-r-- 1 www www 12059 Jan 15 19:04 memberlist.php
-rw-rw-r-- 1 www www 36338 Jan 15 19:04 modcp.php
-rw-rw-r-- 1 www www 34935 Jan 15 19:04 posting.php
-rw-rw-r-- 1 www www 73271 Jan 15 19:04 privmsg.php
-rw-rw-r-- 1 www www 3726 Jan 15 19:04 profile.php
-rw-rw-r-- 1 www www 40443 Jan 15 19:04 search.php
drwxrwxr-x 3 www www 4096 Jan 15 19:04 templates
-rw-rw-r-- 1 www www 23070 Jan 15 19:04 viewforum.php
-rw-rw-r-- 1 www www 7232 Jan 15 19:04 viewonline.php
-rw-rw-r-- 1 www www 45110 Jan 15 19:04 viewtopic.php

The next step is to create a database for your phpBB data. Start up the MySQL command-line client, log into the database server, and create a database named "phpbb".


$ mysql

mysql> CREATE DATABASE phpbb;
Query OK, 1 row affected (0.03 sec)

You can check that the database has been created,


mysql> SHOW DATABASES;
+------------+
| Database |
+------------+
| mysql |
| phpbb |
| test |
+------------+
3 rows in set (0.08 sec)

and then log out.

All that's left now is to create the base tables for the application, configure it to talk to the database, and set an administrator password. phpBB makes all this easy to accomplish via a single-click PHP script, which performs all these tasks for you automatically.

Make sure your Web server is running, and point your browser to the "install/install.php" script of your phpBB installation. For example, if the application was installed to the root of the Web server, you would surf to "http://medusa/phpBB2/install/install.php", where you'd see something like this:

This is the initial application configuration screen, which requires you to enter basic information about your system - credentials for the MySQL database, a username and password for the forum administrator, the Web server host name and application location, a prefix for the phpBB database tables and an email address for administrator notifications. Note that this application configuration module allows you to perform both a new install and an upgrade of an existing installation; you should obviously pick the former in this case.

Once you've entered all the required data, submit the form, and the installation script will go to work creating the tables for you. On successful completion, you should see a screen with the following message.

You can verify that the tables have indeed been created by going back to the MySQL command line and checking for yourself.


mysql> USE phpbb;
Database changed

mysql> SHOW TABLES;
+------------------------+
| Tables_in_phpbb |
+------------------------+
| phpbb_auth_access |
| phpbb_banlist |
| phpbb_categories |
| phpbb_config |
| phpbb_disallow |
| phpbb_forum_prune |
| phpbb_forums |
| phpbb_groups |
| phpbb_posts |
| phpbb_posts_text |
| phpbb_privmsgs |
| phpbb_privmsgs_text |
| phpbb_ranks |
| phpbb_search_results |
| phpbb_search_wordlist |
| phpbb_search_wordmatch |
| phpbb_sessions |
| phpbb_smilies |
| phpbb_themes |
| phpbb_themes_name |
| phpbb_topics |
| phpbb_topics_watch |
| phpbb_user_group |
| phpbb_users |
| phpbb_vote_desc |
| phpbb_vote_results |
| phpbb_vote_voters |
| phpbb_words |
+------------------------+
28 rows in set (0.01 sec)

All there? Good. Before you get into actually configuring your forum for use, there is one more thing you need to do - delete the "install/" and "contrib/" directories from the main application directory.


$ rm -rf /usr/local/apache/htdocs/phpBB2/install

$ rm -rf /usr/local/apache/htdocs/phpBB2/contrib

Leaving these directories behind opens up a serious security hole in your forum...so serious, in fact, that phpBB will refuse to function if they're present, stubbornly displaying the following error until you delete them:

All done? Flip the page, and let's set some global parameters for the application.



 
 
>>> More PHP Articles          >>> More By icarus, (c) Melonfire
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

PHP ARTICLES

- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: