Quick Guide to phpBB

Todo

Making sense of permissions

Try to inject new topic + post in existing forum (migrating from blog)

phpbb email check log

Introduction

This is a quick article on installing the well-known open-source forum phpBB. It'll show how to install it on Linux, but it can also be installed on Windows and Mac. At the time of writing, the latest release if phpBB 3.3.8, and it requires PHP 7/8.

Two good sources of education before diving in are the User's Guide and the Knowledge Base.

Note: The whole site is a "board", while a forum is one of the its sections.

Setup

apt-get update

apt-get upgrade

Vim

apt-get install vim

To make the numeric keypard usable, configure either vim or Putty

SSH

Copier clé publique sur serveur (CintaNotes: SSH: Using public/private key authentication)

Configurer SSH pour se connecter comme root directement

Bash

alias ll='ls -alF --color'

Not remembered even after adding to /etc/bash

OK after also adding /root/

Database

phpBB supports several SQL servers. For a low-traffic site, even SQLite will do. Let's use MariaDB.

apt install mariadb-server

mysql_secure_installation

root/test

systemctl status mariadb

systemctl start mariadb

mysqladmin version

CREATE DATABASE phpBB;
GRANT ALL ON phpBB.* to 'phpBB'@'localhost' IDENTIFIED BY 'test';
FLUSH PRIVILEGES;
EXIT

 

To export a DB:

mysqldump -u root -p mydb > mydb.sql

zip mydb.zip mydb.sql

Web server

Any web server with PHP 7/8 and a few extensions will do. You must install PHP-FPM. Let's use nginx:

nginx

apt-get install nginx

service nginx status

http://server-ip

PHP-FPM

A common mistake is to install the PHP, not PHP-FPM package. The problem with this approach is that unlike PHP-FPM, the PHP package installs the Apache HTTP server and its httpd process, which conflicts with Nginx.

apt-get install php-fpm php-mbstring php-json php-xml php-gd php-mysql php-sqlite3

php -v

service php7.4-fpm status

Check PHP version : /var/www/html/info.php: <?php phpinfo.php(); ?>

chown -R www-data:www-data /var/www/html

chmod -R 755 /var/www/html/

vi /etc/nginx/sites-available/default More infos

nginx -t

service nginx restart

service php7.4-fpm restart

Installing phpBB requires editing nginx's configuration file:

# phpBB
location /phpbb/ {
        try_files $uri $uri/ @rewriteapp;
        
        #access forbidden by rule request: "GET /phpbb/assets/javascript/installer.js?assets_version= HTTP/1.1"
        #location ~ /(config\.php|common\.php|cache|files|images/avatars/upload|includes|(?<!ext/)phpbb|store|vendor) {
        #        deny all;
        #}
        
        location ~ \.php(/|$) {
                include fastcgi.conf;
                fastcgi_param SCRIPT_FILENAME $request_filename;
                fastcgi_param HTTP_PROXY '';
                try_files $uri $uri/ /phpbb/app.php$is_args$args $document_root$fastcgi_script_name =404;
                fastcgi_pass unix:/run/php/php7.4-fpm.sock;
        }
}
 
location @rewriteapp {
        rewrite ^(.*)$ /phpbb/app.php/$1 last;
}
 
location /phpbb/install/ {
        try_files $uri $uri/ @rewrite_installapp;
        
        location ~ \.php(/|$) {
                include fastcgi.conf;
                fastcgi_param SCRIPT_FILENAME $request_filename;
                fastcgi_param HTTP_PROXY '';
                try_files $uri $uri/ /phpbb/install/app.php$is_args$args $document_root$fastcgi_script_name =404;
                fastcgi_pass unix:/run/php/php7.4-fpm.sock;
        }
}
 
location @rewrite_installapp {
        rewrite ^(.*)$ /phpbb/install/app.php/$1 last;
}

nginx -t

service nginx restart

service php7.4-fpm restart

phpBB

phpBB is not available as a Debian package, and must be installed from a tarball.

cd  /tmp

wget phpBB.zip

unzip phpBB.zip

RENAME ? mv phpBB3 /var/www/html/phpbb

chown -R www-data:www-data /var/www/html

chmod -R 775 /var/www/html/

http://server-ip-address/phpbb

Once installed, remove ./install to access the ACP

Style

https://www.phpbb.com/support/docs/en/3.3/kb/article/how-to-install-a-new-style-and-set-it-as-your-default/

https://www.phpbb.com/customise/db/download/197891

Language pack

https://www.phpbb.com/languages/

https://www.phpbb.com/support/docs/en/3.3/kb/article/how-to-install-a-language-pack/

Reading phpBB's data in MariaDB

mysqli

pdo_mysql

phpBB as a portal

phpBB can also be used as poor man's portal by having a PHP script read and dispay posts published in a given section of the forum.

Windows app to read CSS and display as tree? First, clean with Tidy, then open in XMLView.

Backing up the database

Besides the web-based PhpMyAdmin application, there's SQLBackupAndFTP on Windows (the basic version is free).

If you have SSH access, here's how to export and import a database with MySQL/MariaDB:

mysqldump -u [username] -p --opt [databasename] > [backupfilename.sql]
 
mysql -u[username] -p[password] [databasename] < [backupfilename.sql]

Log files

Linux

/var/log/messages

/var/log/dmesg

nginx

/var/log/nginx/access.log

/var/log/nginx/error.log

phpBB

The phpBB generated logs (concerning user, admin, and moderator activity on your board) are stored in the database and accessible through the ACP.

phpBB Peeves

DONE Pas d'interface WYSIWYG, insertion archaïque d'URL https://www.phpbb.com/customise/db/extension/simplewysiwyg

DONE Pas de solution simple pour obtenir lien cliquable vers un post donné ? Désactivé par admin, ou version trop ancienne ?

Pas envoyé directement vers le message le plus récent dans un fil via url#numero (obligé de scroller et chercher manuellement) ?

When hyperlinking, doesn't jump to the "url" section, where the user simply has to paste the URL; Clicking at the right location, typing "=" and pasting the URL isn't very user-friendly.

No option to mark a topic as Solved

Q&A

ISP SMTP doesn't accept outgoing email?

How to find why I'm not receiving the email?

In given topic, jump to first recent post?

… instead of looking for it manually?

Goto first unread post in topic

What columns are required when injecting a topic/post directly through SQL?

SELECT * FROM phpbb_topics;

DESCRIBE phpbb_topics;

SELECT * FROM phpbb_posts;

DESCRIBE phpbb_posts;

Category vs. forum vs. subforum vs. link?

Since phpBB3, a forum can be of three types: Category, Forum, Link

A Category contains forums and/or links. No topics. It can have active/recent posts from multiple forums in it if enabled.

A Link looks like a forum but is actually just… a link. It can have a counter, "Total redirects: 123456"

A forum can also have two sections: Announcements (sticky?) and Topics

Subforums were introduced in phpBB 3.3: "Especially bulletin boards with a high number of forums will benefit from this. In the simple flat category and forum approach in phpBB 2.0, all forums and categories were listed on the forum index. In Proteus you can now put as many forums, links, or categories as you like inside other forums."

WYSIWYG interface instead of BB code?

How to format HTML posts before injecting them in phpBB's database?

Types of post: Normal, Sticky, Announce, Global

Why won't a new forum be displayed until inheriting permissions?

"This part can be a little confusing but to start off it’s important when creating a forum to copy the forum permissions from the default forum. You can change these permissions later if needed. If you don’t do this, no one can access the forum until you explicitly add them later on. This can be very confusing if you are not familiar with phpBB." (Source)

Alternatives to phpBB

Ressources