Build a phpBB Forum in 5 Steps

If you’re thinking of setting up a forum for your Website, you need not start from scratch. The open-source script, phpBB, can easily be installed on most Web servers. This article will describe how to do it right, from downloading through to customisation.

To use this tutorial, you need not know anything about PHP, and need only have had minimum experience with databases.

Introduction to phpBB

phpBB is a stable, open-source, bulletin board script available as a free download from phpbb.com. It allows you to set up an unlimited number of forums and categories. Users, moderators and user groups with varying permissions can be created. In short, it provides everything you’d expect of a bulletin board service. For a complete list of all supported features, see phpbb.com/features.

This software can easily be installed using FTP and a browser. It will run on any PHP-enabled server and requires any one of the following databases: MySQL, PostgreSQL, MS SQL or Access via ODBC.

It doesn’t matter whether your server is running IIS or Apache, though setup tends to be simpler on an Apache Web server. Any Website administrator should be able to install and configure phpBB in a minimum amount of time.

The administrator’s interface allows for ongoing maintenance, so that styles can be changed and topics added or removed. In fact, any administrative duties can be easily performed.

The installation instructions provided at the phpBB site are clear and straightforward. This article does not attempt to replace those instructions but to supplement them and to assist site administrators who are not familiar with PHP. It will help you determine whether you can run phpBB on your server, and if so, how to upload, install and configure it.

System Requirements

As phpBB is written using the server-side scripting language PHP, you need to know whether your Web server supports this language.

If you don’t know the answer to this question, you can always ask your Web host, or upload the following script to your server.

<?php 
 phpinfo();
?>

Use any text editor to create this file and save it as info.php. The actual name of the file is not as important as the extension, .php. In text mode, upload this file to the root directory on your server. View it by typing the address into your browser.

If your server does not support PHP, all you will see are the three lines of code shown above. In this case, get in touch with your Web host and see if PHP can be enabled for your domain.

If PHP is installed, the configuration settings of PHP will be displayed. Assuming that you have PHP enabled on your server, the info.php file will also be useful to help determine if you have the database support needed by phpBB.

Confirming database support for phpBB varies slightly depending upon the Web server you’re running. Let’s first look at Web servers that use Apache.

Apache/Linux

Most versions of PHP on Apache are compiled with support for MySQL databases. You can confirm this by looking again at the "info.php" file. The third line of this file should be the Configure Command. In this line, look for the words with-mysql.

PostgreSQL is not as widely supported, but you should be able to discover whether your server supports it in exactly the same way, but instead, looking for with-pgsql.

IIS/Windows

There will be no Configure Command available when PHP is run on a Windows platform, so we’ll take a slightly different approach to confirm database support here. Again viewing the info.php file, choose Find from your browser’s menu options and search for your database type.

For instance, if we searched for mssql to confirm support for MS SQL Server, we should see something similar to the text below:

1304_table1

In the same way, you can test for PostgreSQL using the search string pgsql, for MySQL using mysql, and for ODBC support using odbc.

Use the info.php file to determine which version of the database you have. You’ll need to know this when we begin the installation, and, with database and PHP support confirmed, we can now begin that process.

Upload The phpBB Files

Assuming you’ve downloaded and decompressed the files for phpBB, everything you need to upload should be in the directory called phpBB2. The only real requirement is that the directory structure be preserved.

Use your favourite FTP program to upload the files to your server. Make sure that all non-graphic files are transferred in ASCII mode. Most FTP programmes will do this automatically for you, based on the file extensions. Make sure your software is configured to transfer all files with the extensions .php, .tpl, .inc, .htm and .cfg as text files.

After the upload is complete, change the permissions on the config.php file so that they’re writeable by all. If you don’t know how to do this, don’t worry about it. The program will give you the option of saving a new config.php file and then overwriting the original.

Prepare for Installation

In preparation for setting up phpBB on your server, you’ll need the following information:

  • Database Server Hostname/DSN
  • Database Name
  • Database Username
  • Database Password
  • Admin Email Address

Let’s discuss this information before we proceed. The host name will be the domain name at which your database is hosted. If your database is hosted on the same server as your Web server, all you need enter here is localhost. If it resides on another server, you can enter the appropriate domain name or the IP address. If instead you’re using ODBC to connect, you will need the connection name. If you are unsure about your situation, clarify the specifics with your Web host.

The database name is, quite simply, the name of the database you’re planning to use. You may use an existing database or create a new one. To create a new database, you may again need to speak with your Web host. If you’re using MySQL with phpMyAdmin, then it’s a relatively simple matter. If you’re using an existing database, table names will be created with a distinctive prefix so that the phpBB tables are readily identifiable.

The username and password need no explanation. The admin email is the email address to which you want questions relating to your bulletin board to be sent.

Installation

With all the information at hand, installation is as simple as pointing your browser towards the install.php file. If you uploaded the directory phpBB2 and its contents to the root directory of your server, the path you need is http://www.<your domain>/phpBB2/install/install.php.

Fill in the text boxes and press the Start Install button. Within seconds you should be finished — installation really is that simple. All the necessary database tables have been created for you. If you wish, have a look at them. There should be a total of 29 new tables — and we haven’t even had to think about SQL!

Shut down your browser, and don’t forget to delete the directories called contrib and install. phpBB won’t run until you do so. If, during the installation, you were asked to download the "config.php" file, you must now upload it to the phpBB2 directory, overwriting the existing file.

Administer Your Forum

To administer your Bulletin Board open http://www.<your domain>/phpBB2/index.php in your browser, and log in with the administrator name and password that you specified on installation. Then, click the Go to Administration Panel link at the bottom of the page. You’ll probably want to go to Forum Admin > Management first, to set up a new forum and categories.

Styles Admin is probably the next area you’ll want to look at, but before you do, go to the phpBB site and see what other styles you might like to download. Upon installation, the phpBB default style, subSilver, is the only one available, but any number of styles may be installed.

After downloading them from the phpBB site, you need to upload your new styles to the Templates directory, which is directly below the phpBB2 directory. After this, new styles must be installed from the Administration panel by going to Styles Admin > Add.

Once you’ve found a theme you like, you can further customise it from the administration panel by choosing Style Admin > Management > Edit. You can associate a theme with an entirely new Cascading Style Sheet (CSS), or you can edit the existing one.

Customise Your Forum

Once you’ve settled on a style, you will doubtless want to further customise it in ways that aren’t available through the Administration panel. For instance, you might want to display your own logo, rather than the phpBB logo.

If you have some knowledge of HTML, minor changes like this are not too difficult. Any changes you wish to make to the appearance of the header can be addressed by making changes to the file called overall_header.tpl. Since this file is included for every page within a style, your changes will take effect throughout the whole bulletin board.

Some other changes can be relatively easy to make. For instance, if it doesn’t make sense to have user groups, the appropriate code can simply be commented out of the overall_header.tpl file.

Be aware that phpBB allows users to choose their own styles, so, unless you choose to override the user’s choice of style from the general configuration menu, any installed templates will be available for users to choose. If you do decide to customise styles and also want to allow users their choice, you’ll have to make the appropriate changes to every style template. One change you shouldn’t make is to the copyright notice on the footer of each page.

Conclusion

With little effort and no cost, you’ve installed a professional bulletin board service on your Website, regardless of the server you’re using and your level of knowledge of PHP and databases. The style of this bulletin board can be easily configured to match the look and feel of the rest of your site, so give it a try!

Win an Annual Membership to Learnable,

SitePoint's Learning Platform

No Reader comments

Comments on this post are closed.