The site recently received a message from someone who wanted to use Flarum beta11 but did not know how to download it. Speaking of Flarum, I had not used it for a long time either, mainly because its update progress was slow. Several years have passed without an official release (although the beta version is actually quite stable).

I had always been using Meto's Flarum CV version. Later, Meto abandoned the project, and the CV version ultimately remained at 0.7.4.

{cat_insidepost id="96"}

After such a long time, I searched for Flarum again and found that several Chinese Flarum sites had stopped developing their Flarum localization projects. Fortunately, the official community is still quite active, and the project was recently updated to beta11. After so many versions, support for Chinese seems to have improved considerably, so I stopped looking for a Chinese version and went directly with the official version. The installation method recommended by the official team is to use Composer, so let's install Composer and give it a try.

Download Composer

First, make sure that PHP is properly installed and available from the command line. PHP 5.3 or higher is required, and OpenSSL must be enabled. Enter php -v in any directory to check whether PHP-CLI is available.

This means it is ready to use. Now begin downloading Composer:

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
# 下载安装脚本
php composer-setup.php
# 执行安装过程
php -r "unlink('composer-setup.php');"
# 删除安装脚本

Install Composer

Local installation

After the Composer download process described above has completed successfully, you can copy the composer.phar file to any directory (such as the project root directory), and then use Composer through the php composer.phar command.

Global installation means installing Composer in a path included in the system environment variable PATH. You can then execute the composer command directly in the command-line window:

mv composer.phar /usr/local/bin/composer

After installation, use composer --version to check whether the version number is output correctly. Don't forget to run composer self-update regularly to keep Composer up to date!

Change the Mirror Source

Composer uses packagist.org by default, which makes access particularly slow for servers in China. A few years ago, when Composer was not yet as popular, only one Chinese Composer website in China had set up a domestic mirror source.

I tried it, and its access speed is now even slower than that of the official source, making it practically unusable. However, as Composer has developed, many major companies have joined the Composer mirror network. Let's switch Composer's default source:

Alibaba Cloud Composer Mirror
https://mirrors.aliyun.com/composer/
Tencent Cloud Composer Mirror
https://mirrors.cloud.tencent.com/composer/
Huawei Cloud Composer Mirror
https://repo.huaweicloud.com/repository/php/
Anchnet Cloud Composer Mirror
https://php.cnpkg.org

Alibaba Cloud is highly recommended because it has a fast synchronization frequency and very stable speeds.

All projects will use this mirror address:

composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/

To remove the configuration:

composer config -g --unset repos.packagist

Project configuration

This only modifies the configuration of the current project, so only the current project can use this mirror address:

composer config repo.packagist composer https://mirrors.aliyun.com/composer/

To remove the configuration:

composer config --unset repos.packagist

That's all for today. Tomorrow I'll write about how to use Composer to install Flarum beta11.