About this site

Note that this version of the module is discontinued (unless someone sponsors its continuation), please look at the phpBB 3.x version instead.

Drupal-5.1 / phpBB 2.x version (also discontinued): http://kepp.net/drupal-5.1

This site is a test-installation of the module that provideds integration between Drupal and phpBB, using Drupal as the master. Feel free to create an account and test it yourself.

The module requires Apache 1.x or 2.x with mod-rewrite enabled, MySQL 4.x, PHP 5.x or 4.x, Drupal 4.7.x and phpBB 2.0.22 and a a lot of experience. If you do not know how to create a database connection in PHP you are probably better off using the regular forums in Drupal, or purchasing a support contract from i1 Media.

Example installation

Install a complete site that uses this module in 20 minutes (or so). Most the issues people report on Drupal.org are misconfigurations. If you find errors please use the setup below to test them, or see whether you can reproduce the error on this site.

Installing Drupal:
1) Go to your webroot:
cd [your webroot]
Download the file
wget http://ftp.osuosl.org/pub/drupal/files/projects/drupal-4.7.6.tar.gz

2) Unpack Drupal, create the database
tar xzvf drupal-4.7.6.tar.gz
cd drupal-4.7.6
mysqladmin -u root -p create drupal476
mysql -u root -p drupal476

3) Create a new MySQL user:
GRANT ALL ON drupal476.* TO drupal476@localhost IDENTIFIED BY 'drop22Water';
exit

4) Populate the database
mysql -u drupal476 -p drupal476

5) Edit sites/default/settings.php using a text-editor, gedit in this case
gedit sites/default/settings.php
6) Update the file with the database information and save
$db_url = 'mysql://drupal476:drop22Water@localhost/drupal476';

7) Point your webbrowser to the installation and create the first user, I will call him admin_drupal:
http://localhost/drupal-4.7.6/

8) This module REQUIRES that you have mod_rewrite working, so lets check that next:
Go to administer -> settings -> general settings. There you'll find a link to "Test clean URLs",
click on it. If you get "404 Not Found" there is no point in proceeding any further, make sure you have this working first.

If you happen to be using Ubuntu 6.06, like I do on my laptop, you want to enable .htaccess files:
Change "AllowOverride none" to "AllowOverride all" in the /var/www section of /etc/apache2/enabled-sites/000-default. Then restart Apache

9) Once you have enabled and verified "Clean URLs": Enable uploads of avatars
mkdir files && chmod 777 files
(better, but not always an option: "mkdir files && chmod 755 files && sudo chown www-data files")

10) Verify the Drupal is happy, go to:
http://localhost/drupal-4.7.6/admin/settings
or similar URL and check the "File system settings" section.

11) Enable avatars in Drupal:
http://localhost/drupal-4.7.6/admin/settings/user
Under "pictures" press "Enabled" and Save configuration. This will create the folder "files/pictures".

12) Create the phpBB administrator:
Drupal uses user id 1 for the admin (superuser), phpBB uses user id 2 for some odd reason. This means we need to have control over the user. If this is a fresh install you can simply create another user:
http://localhost/drupal-4.7.6/admin/user/create
Give him the name admin_phpbb and remember the password for later! If you have an existing Drupal installation you should claim the user id by changing the username, password and email:
http://localhost/drupal-4.7.6/user/2/edit
(My apologies to user number 2, but there is no safe alternative.)

Install phpBB
This module depends on the database structure of phpBB. The version as of 2006-06-22 has been tested with phpBB 2.0.19 through 2.0.22. It may work with newer versions, check the update notes whether the session, user or group tables remain intact.

To make the installation procedure as general as possible, I will create a separate database, use a prefix and place it in an arbitrarily named directory. You can install phpBB in the same database, in which case you really should use a prefix for the tables.

13) Download and unpack phpBB:

wget http://kent.dl.sourceforge.net/sourceforge/phpbb/phpBB-2.0.22.tar.gz
tar xzvf phpBB-2.0.22.tar.gz

14) I will place phpBB in the subdirectory called "forum". It can be named anything you want, but it has to be a subdirectory of Drupal:
mv phpBB2 forum

15) Make the configuration file writable:
chmod 666 forum/config.php

16) Create the database:
mysqladmin -u root -p create drupal_phpbb

17) Create a MySQL user for phpBB
mysql -u root -p drupal_phpbb
GRANT ALL ON drupal_phpbb.* TO drupal_phpbb@localhost IDENTIFIED BY '7bigBird7';

18) Start the installation:
http://localhost/drupal-4.7.6/forum/install/install.php

19) I use the following settings (other than defaults):
Database Type: MySQL 4.x/5.x
Your Database Name: drupal_phpbb
Database Username: drupal_phpbb
Database Password: 7bigBird7
Prefix for tables in database: phpbb_
Administrator Username: admin_phpbb

.... fill in the remaining fields and press "Start Install"

20) Delete the install and contrib directories

Configure phpBB

21) Go to the "Administration Panel". You can pretty much configure phpBB to your liking. When you are done, go to
General Admin -> Configuration.
The following MUST be set as follows:
Enable account activation: Admin (All users MUST register through Drupal, which bypasses this)
Allow automatic logins: Yes (The module requires this mechanism)
Cookie settings: Leave all of these as defaults: ( , phpbb2mysql, /, Disabled, 3600)
Private Messaging: Disabled (We'll use Drupals module for this)
Enable gallery avatars: No (user will have no way of selecting it)
Enable remote avatars: No (user will have no way of selecting it)
Enable avatar uploading: Yes (Drupal will handle this, but otherwise the links don't show up)
Maximum Avatar File Size: (Leave as default)
Maximum Avatar Dimensions: (Leave as default)
Avatar Storage Path: ../ (Drupal will provide the rest of the path)

Save the configuration.

Install the integration module
22) Your forum should now be ready to go. It is time to install the phpBB-module:
wget http://ftp.osuosl.org/pub/drupal/files/projects/phpbb-cvs.tar.gz
tar xzvf phpbb-cvs.tar.gz
mv phpbb modules

The last line should be adjusted so that you have a subdirectory named phpbb in the modules directory of Drupal.

23) Go to addminister -> modules
http://localhost/drupal-4.7.6/admin/modules
Enable phpBB and press "Save configuration"

If you get an error, that config.php cannot be included, create a copy of the forum and name the directory phpBB2. Configure (setting paths to phpBB2), then delete this directory.
24) Log in as the Drupal administrator, then go to addminister -> settings -> phpbb

http://localhost/drupal-4.7.6/admin/settings/phpbb

25) For now, only modify
Relative location of phpbb: forum/
and
Absolute path to phpbb: /drupal/forum/
and any character encoding settings (the defaults will be good for most), press "Save configuration".

26) We now have to activate the phpbb-page, which is used to redirect people to logins etc.:
http://localhost/drupal-4.7.6/admin/menu
I am not sure how this is supposed to work, but the way I do it is that I enable the page named phpbb, and then i disable it. This removes it from the menu, but it is still accessible when the .htaccess file redirects people there.

Testing cookies and sessions
27) Press log out, then go to your forum and make sure you are logged out there too.
http://localhost/drupal-4.7.6/forum/

28) Delete all the cookies in your webbrowser, then go to Drupal's front page and log in as admin_phpbb. Then go to
http://localhost/drupal-4.7.6/forum/
You should (magically) be logged into the forum as admin_phpbb as well.

Testing profile changes
29) Go to your profile in Drupal and press edit:
http://localhost/drupal-4.7.6/user/2/edit
Upload a picture and make sure it is displayed in your profile in Drupal.

30) Now go back to the forum and check the welcome post or create a new one. Verify that your avatar is displayed.

Faking integration through redirects
31) Copy the phpbb.htaccess-file to the forum-directory, renaming it in the process:
mv phpbb.htaccess forum/.htaccess
This file will redirect requests to login/logout, private messages, profiles and other stuff to be handled by Drupal.

Install additional modules
32) Download and install the private messaging module
http://ftp.osuosl.org/pub/drupal/files/projects/privatemsg-4.7.0.tar.gz
tar xvzf privatemsg-4.7.0.tar.gz
mv privatemsg/privatemsg.* modules
mv privatemsg/po modules
rm -Rf privatemsg

33) Enable the privatemsg and the custom profile modules
Go to administer -> modules, select "profile" and "privatemsg" and click save settings

Alternatively, as suggested by Coyote , you can use phpBBs tools for profile management by disabling the profile portions in the .htaccess file and modifying phpBB a bit. However, this will cause a disconnect between the two profiles.

34) Let people use the privatemsg module
Go to administer -> access control and enable "access private messages" for authenticated users.

35) Insert the phpbb-fields into the custom profile:
phpBB has many more fields than a standard Drupal installation, this is a way to integrate them
download this SQL-file: http://kepp.net/drupal/phpbb_profile_fields.sql.txt
It is in UTF-8 and assume your database has no prefixes and no previously defined profile fields.
36) Insert the SQL.
mysql -u drupal476 -p drupal476
If you use prefixes you must also modify the module, search for and replace profile_values and profile_fields with whatever is appropriate.

37) Verify the new profile fields:
http://localhost/drupal-4.7.6/user/1/edit/phpBB

If you use prefixes in your database you have to edit the module, look for the function _phpbb_get_profile_value and add your prefix.

You are almost good to go, the remaining changes are cosmetic, but there are some things you need to know:

Important tips
1) There is a new setting under "access control" in Drupal ("administer phpbb"). You should create a role "phpbb admin", and only make admin_phpbb a member of this group.
2) If you get emails about users that have registered through phpBB then do not activate them. They are most likely spambots.
3) You can administer moderators through phpBB, without involving Drupal at all.
4) There is a block in Drupal that will display links to the latest topics in the forum.

Now you may want to customize your phpBB template to make it seem more integrated into Drupal.
If you use subSilver as your starting point:
1) Remove the login-section on the forum's front page (index_body.tpl)
2) If you simply want to encapsulate the forum, the easiest way to do it is to create a table that spans from overall_header.tpl to overall_footer.tpl.

You can download the slightly modified version of subSilver here: http://kepp.net/drupal/subsilver.tar.gz. Look for the *~ files to see what I have changed.