The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
Phorum Installation 25 August 2003
Need more help on this topic? Click here
This article has no comments
Show me similar articles

Phorum and PostgreSQL are two tools which I have used for several years and which I recommend to others. If you're looking for a message board or a database, these are what I think you should get.

In this article I'll talk about installing and configuring Phorum. I'll provide detailed step-by-step instructions. They will work for both a new install and an upgrade.

The agenda for today....

Today we will do the following:

  • download the latest Phorum
  • install Phorum for the PostgreSQL installation
  • configure Phorum
  • Create our forums

And if that's not enough for you, we'll also do some of this:

  • Customize to make it look like the rest of our website
  • Fix some nits in the html
You will find all of the above steps detailed in this article.
Backup your data

I suggest taking your Phorum offline via its administration interface. This will prevent any updates by your Phorum users.

The first step should be a backup of your Phorum data. My original MySQL article has some rudimentary backup steps. As does my PostgreSQL article.

Create the PostgreSQL database

Phorum stores data in a database. You need to first create that database. This article will not concentrate on the PostgreSQL details as I'm going to assume you have previous experience. This previous article might help. Now we'll create the database:

$ createdb phorum_conversion

Note that you can also use MySQL.

Download and Install Phorum

Phorum can be downloaded from the main home page or from their download page. I'm running FreeBSD so I grabbed

$ fetch
Receiving phorum-3.4.3a.tar.gz (167667 bytes): 100%
167667 bytes transferred in 1.6 seconds (100.84 kBps)
$ tar xfz phorum-3.4.3a.tar.gz

This created a phorum-3.4.3a directory which I renamed and moved into my website:

mv -i phorum-3.4.3a /path/to/my/website/phorum

Take care to not overwrite any existing data

Now we should be able to access Phorum from our website and that is how we will do the configuration.

Configuration - language selection

Phorum is configured via a web-based interface. It is quite straight forward. If your website is, and you put the phorum directory in the root directory of this website, you should point your browser at If everything has been set up correctly, you should see this message in your browser:

You didn't setup your database. Go to the admin (default admin/index.php) and complete the installation.

Click on the link to go to the Phorum Installation, which looks like this:

Phorum Installation Language

I selected English and clicked on Next Step. This is when I encountered my first problem. It was a permission issue. Here is what Phorum had to say about it:

Phorum Installation Database

This problem is caused by permission on the settings directory. Here are the default permissions:

$ ls -ld admin/settings
drwxr-xr-x 3 dan dan 512 Jun 27 08:54 admin/settings
Phorum needs to be able to create new files within that directory and modify any files which are already there. Phorum will be running as the user www because that is what Apache will be running as. This is the default setting for the FreeBSD Apache ports for some time. Check your installation for details or ask your system admin.

I modified the permissions with this command:

chown dan:www admin/settings
chown dan:www admin/settings/forums.php
chmod g+w admin/settings
chmod g+w admin/settings/forums.php

A quick check verifies that Phorum will now be able to create new files in this directory:

$ ls -ld admin/settings
drwxrwxr-x 3 dan www 512 Jun 27 08:54 phorum/admin/settings

And similarly, Phorum will be able to modify the file:

$ ls -l admin/settings/forums.php
-rw-rw-r-- 1 dan www 1987 Jun 17 07:19 phorum/admin/settings/forums.php

Now I'll click back on my browser and go to the previous page and then click on Next Step again. This time, things are as they should be, as demonstrated by the picture in the next section.

Configuration - database type

Phorum Installation Database - 2

If you are upgrading your MySQL installation, you should select MySQL. If you are configuring the new PostgreSQL installation, you should select PostgreSQL 6.5 or newer. Then click on Next Step.

Configuration - database initialization

Phorum Installation Database - 2

What you supply in the above page depends on what you are doing. If you are upgrading the MySQL installation, you should supply the MySQL database details and be sure to click on "Check here is this is an upgrade". If you are configuring the PostgreSQL installation, you should supply the PostgreSQL details.

My database server and my webserver are on the same machine. There was no need to supply a Server Name. But here is what I did supply:

  • Database - Name: phorum_conversion
  • Database - User Name: dan
  • Database - Password: password

This is not necessarily the best and most secure setup, especially for a production or shared server. I was doing this on my development box, on which I am the only user. I will eventually dump the data and upload that to my production server.

After entering the above values, I click on Next Step.

Configuration - Admin user

If you are creating a new installation, the following picture demonstrates what you should see:

Phorum Installation Admin

Click on help for more information about this user. I supplied the details and click on Next Step.

In the following picture, you can see that the Phorum upgrade process has altered various tables and updated a field in each forum table. This applies only if you are upgrading an existing Phorum installation.

Phorum Installation Admin - Upgrade
Configuration - Phorum URL + Admin details

If you are creating a new installation, this picture demonstrates what you should see. The results will differ if you are upgrading an existing installation and the user you specified in the previous step already existed.

Phorum Installation Step 5

The URL supplied for me was correct. You can change it later if you want to. I filled in my email address and the name I wanted to use within Phorum. Then I clicked on Next Step.

Configuration - done

Phorum Installation Done
By clicking on the "Click here" link, you will be taken to the main administration page. If you should be taken back to the Step 1 of the installation, press reload on your browser and you should see the administration interface.
Administration Interface

Phorum Admin

So far we have managed to install Phorum, create the database, and configure it for our needs. Next, we will create the forums within Phorum.

Create our [PostgreSQL] forums

New forums can be created using the Phorum Admin pages (at /phorum/admin/index.php of your installation). Select New Forum from the Forum Maintenance.

  • Name: FreeBSD Support
  • Description: Ask for help here
  • Table Name: support
Then I clicked on Add.

Phorum Installation - Forum Admin

I clicked on Main Menu and repeated the process for the other forums.

Don't like the date format? Change it!

Out of the box, the Phorum date format is m-d-y. Naturally, that's unnatural. But you can change it to something better. The file you want is lang/english.php. Look for the date_format function down around line 170 or so. The code contains references to the PHP documentation so you can design your own date format if you don't like mine.

The date format I use is:

$sDate = date("d-m-y H:i",$tstamp);
Don't like the text alignment? Change it!

When an author name gets long, it will wrap, which leaves the text on the line centered within the row. I prefer to have it top aligned. So I changed it.

The file I modified is phorum.css. The part I modified is:

    font-family: Verdana, Arial, Clean, Helvetica, sans-serif;
    font-size: 12px;
    height: 21px;

I added this line to the above declaration:

    vertical-align: top;
Customize the look

You can change the look and feel of Phorum by modifying include/footer.php and include/header.php. Just create a page which looks just like you want it, then split it at the point where you want Phorum to appear. Then put the top stuff in header.php and the bottom stuff in footer.php.

For more information, please try my Phorum first article.

Fixing some HTML nits

I've taken a liking to having correct HTML. As a result of this liking, I've started validating my own pages with that link at the bottom of the page. It's allowed me to find many errors, which browsers seem to cope with regardless. Why validate? If I know my code is valid, then it should render the same, without error, on any browser. Well, any browser which follows the standards. I've made my changes available to the Phorum community. You can use them too if you want.

And wouldn't you know it!

On the same day I finished writing the above, Phorum 3.4.4 came out. DOH! Not to worry. The above process will work for that version too.

Go Phorum!

Phorum is a very good and solid product. It runs great on both MySQL and PostgreSQL. I like it much better than any other forum software I've seen. I recommend it.

Need more help on this topic? Click here
This article has no comments
Show me similar articles