This article might evolve following the evolution of my phpBB deployment and the discovery I might do.
Let say you want to deploy phpBB on Clever-Cloud. This example is based on phpBB 3.3.11.
First, for now, as far as I know phpBB can’t be deployed immutable way, so you’ll need the equivalent of a server deployment, witch mean : file-storage + data-base + php-runtime.
Tools : you’ll just need a text editor and a ftp/sftp client.
Let’s go !
Download the last release of phpBB, unzip the archive into a directory named phpBB3.
Login into your Clever-Cloud console, create an new application, select create -> an application -> create brand new app, select PHP, select FTP, choose your scaling, name your application and select the data center, select a data-base add-on (Postgres), choose the size of you data-base, name your data-base, finally validate. Know you have your run environment.
Now you can connect to you FTP server with your FTP client, you can find the connection details into de FS Bucket parameters.
Upload the pre-unziped phpBB directory.
Now configure your runtime, open the information section, choose what you need and save, do the same in the scalability section, for the domain name section you can add your domain if you have one and configured it following the documentation, the environment variable is the interesting part.
In the environment variable the minimum to add is CC_WEBROOT="/phpBB3", the other option you can tune are listed here : https://developers.clever-cloud.com/doc/reference/reference-environment-variables/#php
After configuring all the environment variable you want, you’re know ready you click the start or re-build and configure your phpBB board.
Bonus, if you know the clever cloud way of working, you’ll probably want to make sure that phpBB use your databases url & user & secret directly from environment variables. To do so, after the first deployment and configuration, connect to the filesystem (ftp), search for the config.php file, edit it, and put something like this :
<?php
$dbms = 'phpbb\\db\\driver\\' . getenv('PHPBB_DB_DRIVER');
$dbhost = getenv('PHPBB_DB_HOST');
$dbport = getenv('PHPBB_DB_PORT');
$dbname = getenv('PHPBB_DB_NAME');
$dbuser = getenv('PHPBB_DB_USER');
$dbpasswd = getenv('PHPBB_DB_PASSWD');
$table_prefix = getenv('PHPBB_DB_TABLE_PREFIX');
$phpbb_adm_relative_path = 'adm/';
$acm_type = 'phpbb\\cache\\driver\\file';
@define('PHPBB_INSTALLED', true);
if (getenv('PHPBB_DISPLAY_LOAD_TIME') === 'true') {
@define('PHPBB_DISPLAY_LOAD_TIME', true);
}
if (getenv('PHPBB_DEBUG') === 'true') {
@define('DEBUG', true);
}
if (getenv('PHPBB_DEBUG_CONTAINER') === 'true') {
@define('DEBUG_CONTAINER', true);
}
Before restart your runtime, update the configuration env vars by something like that (example with MySQL database) :
PHPBB_DB_DRIVER = mysqli # Options: [mssql, mysql, mysqli, oracle, postgres, sqlite, sqlite3]
PHPBB_DB_HOST = ${MYSQL_ADDON_HOST}
PHPBB_DB_PORT = ${MYSQL_ADDON_PORT}
PHPBB_DB_NAME = ${MYSQL_ADDON_DB}
PHPBB_DB_USER = ${MYSQL_ADDON_USER}
PHPBB_DB_PASSWD = ${MYSQL_ADDON_PASSWORD}
PHPBB_DB_TABLE_PREFIX = phpbb3_ # Your table prefix
PHPBB_INSTALLED = true
PHPBB_DISPLAY_LOAD_TIME = false # Up to you
PHPBB_DEBUG = false # Up to you
PHPBB_DEBUG_CONTAINER = false # Up to you
Leave a Reply