Sunday, November 10, 2013

[How to] Install PhpBB in Drupal

In this module, I'll explain how to Integrate PhpBB in Drupal. I checked a lot over Internet and the results seems to confusing than problem solving. Somehow, I found the solution by reading documentations (Read me files) at PhpBB website and Drupal website.

PREREQUISITE : The module requires php5 to run.
  1. Back up your Drupal and Phpbb3 folders.
  2. Install PhpBB by following instructions from this post. While copying the decompressed files, copy them to the Drupal folder.
  3. In order to integrate, we need to use phpbbdrupalbridge module in PhpBB3 and Phpbbforum module in Drupal. By using these two, we can create a link between them.
  4. First lets go with bridge. Download the MOD from
  5. Unpack the archive directory.
  6. Open root folder in the phpdrupalbridge directory.
  7. Copy the contents in folders includes/ & styles/ to /phpBB3/  folder.
    Example 1 : phpdrupalbridge-3.0.10/root/includes/phpdrupalbridge/phpbb_api.php to /phpBB3/includes/phpdrupalbridge/phpbb_api.php
    Example 2 : phpdrupalbridge-3.0.10/root/styles/prosilver-embed to /phpBB3/styles/prosilver-embed
  8. If any files are asking for overwriting, click yes and overwrite them.
  9. Copy ../root/images directory to Drupal images directory.
  10. Do not forget to add a line " Disallow: /images/ " (without quotes) to your robots.txt file (I'm not sure about this line. I didn't do this. If something goes wrong, perform this step and try)
  11. Goto PhpBB installed location in your browser
  12. Login using admin credentials
  13. Goto ACP (Administrative Control Panel) (Most probably Link is available at the bottom of your webpage)
  14. Go to General tab --> Server settings 

     Note : These are Example settings. Let's say I hosted XYZ website in subfolder of Even though I have as my domain, I should point to base domain only in this case. That is the meaning of base url below )

    • Domain$base_url = '';

    • Domain$base_url = '';

      Look for " 
      $base_url " in the file /sites/default/settings.php and change that to match the address to your drupal installation. You shouldn't put trailing slash. Drupal will add it for you dynamically.
    • Script path/xyz/phpBB3
      If you have drupal and phpBB3 installed in subdirectory you must enter
      Script path/subdirectory/phpBB3
      NOTE : I have phpBB3 installed in subfolder of my drupal. Drupal is installed in abc/xyz folder. phpBB is installed in abc/xyz/phpBB3/
    • Force server URL settings(*) Yes  () No.
  15. Go to General tab --> Cookie settings

    Cookie domain:
    Cookie name: [any random name of your choice]

    My Example.. Cookie namephpbb3_1f2g9
    Cookie path: /

    ( Note: your domain name with leading dot. )
  16. Go to General tab --> User registration settings
    • Account activation: () Disable () None (*) By User[Email-verification] () By
    • AdminUsername length: 3 - 30
    • Password length: 6 - 30
  17. Go to General tab --> Security settings
    • Check IP against DNS Blackhole List: () Yes (*) No
    • This can be enabled if security attacks are increasing
    • Check e-mail domain for valid MX record: () Yes (*) No
    • If enabled, the e-mail domain provided on registration and profile changes is checked for a valid MX record.
  18. Go to General tab --> Load settings
      • Session length: 22100Sessions will expire after this time, in seconds. So, set this value according your needs.
    1. Go to ACP --> Styles tab 
        • prosilver-embed --> Install
          • subsilver2-embed --> Install

            In the Install style make sure that the style is active. Do not make it default.
        1. Clear phpBB cache. To do this,

          Go to General tab -->  In the middle of the page (vertically) you can find, 
        2. By default, the phpbbdrupalbridge MOD installs phpbbdrupalbridge API files into the ../phpBB3/includes/phpbbdrupalbridge/ directory.
        3. Move it to the sites/all/modules/phpbbforum/includes/ directory.
          Example : Move /phpBB3/includes/phpbbdrupalbridge/phpbb_api.php to sites/all/modules/phpbbforum/includes/phpbbdrupalbridge/phpbb_api.php 
          ( Note : You should use only one copy of /phpbbdrupalbridge directory )
        4. Now we have to install to Phpbbforum module in Drupal. To do this, Download the phpBBforum module from
        5. Unpack the archive.
        6. Copy all the contents to sites/all/modules/phpbbforum/

          : Downloaded phpbbforum/css/phpbbforum.css to server sites/all/modules/phpbbforum/css/phpbbforum.css
        7. Remember that we didn't test our   after installing the bridge and module. We need to check now. To test how you will be authenticated, login to your phpBB forum as admin.
        8. Next step is to go back to Drupal admin dashboard. Login to Drupal site as admin
        9. Go to Modules tab.
        10. Enable the phpBBforum module.
        11. In order to run phpBB inside of drupal page correctly, clean URLs must be enabled.
        12. To do this, go to Dashboard >> Configuration >> Clean URLs --> Enable and save.
        13. Go to Dashboard >> Configuration >> phpBBforum settings.
        14. You can see the erroneous phpBBforum status. 
        15. Even if you fill correct settings here, it throws you an error.
        16. This is because of bug in bridge/module.
        17. So replace the ../phpbb3/includes/functions_user.php with this file.
        18. Now go to Dashboard >> Configuration >> phpBBforumsettings.
        19. To see the success message, fill the settings as below
          • phpBB forum root path : /home/ .. /public_html/ .. /phpBB3/
          • Path to phpBB api file  :  /home/../public_html/../sites/all/modules/phpbbforum/includes/phpbbdrupalbridge/
          • phpBB api file name : phpbb_api.php 

            Note : If you ignore trailing slashes or if you don't give full path here, Drupal won't read PhpBB database )
        20. If you didn't move the folders, as mentioned in steps 21 & 22 above, above gives you error again. 
        21. In the same page, scroll down for the section phpBB page settings. Fill the following.
          phpBB display wayIn the Drupal page
        22. Scroll to Profile fields mapping section.
        23. You can see field names like field_gender  over there. These fields are nothing but attributes of a user in the website.
        24. These field names should match with the Drupal user registration form field names. By default, these fields doesn't exist in a Drupal fresh install. So we need to create them. To create fields, leave the webpage like that and open a new browser tab, go to Dashboard --> Configuration --> Account Settings --> Manage fields tab (On top right corner)
        25. Create fields that match with the name i.e same name as in previous phpBBforumsettings page.
          Example : field_gender
        26. After creating all those fields, save them
        27. Now come back to phpBBforumsettings tab make sure that you checked Drupal master for Select master registration system in phpBB/Drupal settings. If this is in phpBB master, users will get Access Denied error when users try to click on Create New Account in Drupal homepage. 
        28. Set other settings if you want and Save configuration.
        29. After above steps, the phpBBstatus field which showed error before, displaya success message.
        30. Navigate to Dashboard --> Structure --> Blocks
        31. Enable phpBBforum: Hidden authentication block.
        32. Configure its settings as below.
          Show block on specific pages :  * Show on every page except the listed pages.Pages:    " user/reset/* " Hit Enter
              " user/password " ( without quotes )
        33. If you want advanced synchronization, do not disable it in the future even. Enable the phpBBforum blocks you want to use (optional).
        34. Check whether the link  is working fine in your browser.
        35. If page phpbbforum is not found, Go to Dashboard >> Configuration >> Performance -->  Clear cached data
        36. To setup a link to phpbbforum page, go to Dashboard >> Structure >> Menus >> Navigation
        37. See Menu item with blank title in state (Disabled)
        38. You may enable it if you do want phpbbforum in Navigation menu too. Note that Menu link title is mandatory.

          ( Note : To remove this in future, you need to remove the page title )
        39. Go to Dashboard >> Structure >> Menus >> Add links -->  Enter Menu item as phpbbforum.
        40. The name that appears in URLs for PhpBB forums is phpbbforum
        41. To change this name you should add URL aliases. For URL aliasing, go to Dashboard --> Configuration --> URL Aliases     
        42. Let us say, we want to use the term 'forums' instead of phpbbforum in URLS.
        43. Click Add Alias. Add each alias as below.
          1.     phpbbforum -> forums
          2.     phpbbforum/index.php -> forums/index.php
          3.     phpbbforum/viewtopic.php -> forums/viewtopic.php
          4.     phpbbforum/viewforum.php -> forums/viewforum.php
          5.     phpbbforum/viewonline.php -> forums/viewonline.php
          6.     phpbbforum/memberlist.php -> forums/memberlist.php  
          7.     phpbbforum/posting.php -> forums/posting.php
          8.     phpbbforum/search.php -> forums/search.php
          9.     phpbbforum/ucp.php -> forums/ucp.php
          10.     phpbbforum/mcp.php -> forums/mcp.php
          11.     phpbbforum/faq.php -> forums/faq.php
          12.     phpbbforum/report.php -> forums/report.php
          13.     phpbbforum/adm/index.php -> forums/adm/index.php
        44. If existing path is : , it comes as Note :  Use a relative path and don't add a trailing slash or the URL alias won't work. )
        45. To setup content submission to phpBB forum go to Dashboard --> Structure --> Content types   --> Add content type
        46. Give name as phpBBforum. 
        47. Go to phpbbforum submission settings ( left bottom of same page )
          Drupal to phpBB submission: (*) Enabled
          This requires Drupal to phpBB node submission : enabled in phpBB topic submission settings in phpBBforum settings in Dashboard --> Configuration
        48. Download my patch files from here
        49. Copy all those to your /PhpBB3 folder on server in. If asked, click yes to override
        50. You're done with integration. Have a coffee. :)

          NOTE : PhpBB forum links in menus and navigation appears only after login as authenticated user

        If you enjoyed this post, make sure you subscribe to my RSS feed! Comments are encouraged

        Write comments
        1. Your patch link is broken :/

        2. Can you update the link to your patch please?