Flarum released version 0.1.0-beta.11 a few weeks ago; see Flarum 0.1.0-beta.11 Released. So let’s take a look at how to perform a fresh installation of this version. The previous article already covered installing Composer and switching to a domestic mirror, so the following steps are very convenient.

Preparation

My test environment is as follows:

Apache 2.4
PHP 7.3
MySQL 5.6

The server requirements in the official documentation are:

Apache(启用 mod_rewrite)或 Nginx
PHP 7.1+ 具有以下扩展名:curl,dom,gd,json,mbstring,openssl,pdo_mysql,tokenizer,zip
MySQL 5.6 以上或 MariaDB 10.0.5 以上
SSH(命令行)访问以运行 Composer

The official documentation seems not to mention one very important extension: fileinfo. This extension is required by Flarum and can be installed directly through the Baota panel, so it is very simple.

If the available memory is less than or equal to 1G, the installation may fail. In that case, you need to add swap memory to ensure that the installation succeeds. I will not go into detail about how to add it; the Linux Toolbox in Baota has the relevant option.

Create a new site. It is recommended to choose utf8mb4 for the database encoding, although utf8 is also fine.

Let me first mention something that was not covered in the previous article. Many warnings appeared while using Composer, such as the following:

According to the warnings, the relevant functions were probably disabled by Baota’s default PHP configuration. I summarized them, and the functions that need to be removed are as follows:

putenv
pcntl_signal
proc_open

Start Installation

First, cd to the website root directory and run rm -rf * to delete all files.

Delete Files

Well, I tried it, and rm -rf did not delete everything. It is better to delete the files through the file manager in the Baota panel instead. .htaccess and .user.ini must also be deleted to ensure that the directory contains no files. Then install directly using Composer:

composer create-project flarum/flarum . --stability=beta

The installation will be complete after a while. Do not rush to visit the site yet; first install a Simplified Chinese language extension:

# 繁体中文
composer require csineneo/lang-traditional-chinese
# 简体中文
composer require csineneo/lang-simplified-chinese

Then change the permissions of all directories and files under the website directory to 755, and point the website’s running directory to /public.

You can now access the website!