AMH 5.X under Installation Flarum

Source: Internet
Author: User
Tags php and mysql forum software
Recently inadvertently found a few open source software bug feedback system used is Flarum, Flarum is an elegant and concise forum software, looks pretty good, a moment to suppress want to try.

Because the server is using the AMH integration environment, it has a lot of differences from the usual direct installation environment, which leads to a lot of problems during the installation process. Here's a summary.

Flarum

Flarum is an elegant and concise forum software that makes online communication easier and more enjoyable.

    • Website
    • Chinese station

AMH

AMH is the first open source host panel in China, AMH supports users to set up running environment and switch environment freely and flexibly, you can download and install different versions of Web server, database and script software to create the environment you need.

I'm using the AMH5. For the paid version of X, the free version of 4.X can also refer to this tutorial.

The current server environment is LNMP:

CentOS-6.6 64-bit

lnmp-2.5

mysql-generic-5.5.40

nginx-generic-1.6.0

php-7.0

Composer

Composer is a tool that PHP uses to manage dependency (dependency) relationships. You can declare your dependencies on the External tool Library (libraries) in your project, and Composer will help you install these dependent library files.

    • Website
    • Chinese station

Composer is a necessary tool for installing Flarum.

Installing PHP Extensions

Here you need to install flarum necessary PHP extensions, first look at the system requirements:

Flarum System Requirements

Server: Apache (requires support mod_rewrite), Nginx, Lighttpd

PHP 5.5+, extensions required to open: mbstring, Pdo_mysql, OpenSSL, JSON, GD, DOM, FileInfo

MySQL 5.5+

Special Note: PHP is 5.5+, MySQL 5.5+, if the version is too low can be used to install a higher version of AMH, AMH support multi-version PHP and MySQL.

Process:

    1. Log in to the admin panel of AMH
    2. Software downloads > fileinfo-1.0 > Downloads and installs to the appropriate environment
    3. Software downloads > mcrypt-1.0 > Downloads and installs to the appropriate environment
    4. Software downloads > pdo_mysql-1.0 > Downloads and installs to the appropriate environment

Installing composer

The documentation for the Flarum official website requires installation using the composer command line, so you need to install composer first:

After logging in to the server using SSH: Execute

Curl-ss Https://getcomposer.org/installer | Php

Note: If the above method fails for some reason, you can also download the installer via PHP >:

Php-r "ReadFile (' Https://getcomposer.org/installer ');" | Php

Here you may encounter-bash PHP command not found error, please refer to the following issue highlights .

PS: Install composer documentation

Installing Flarum

Environment is set up, here to explain the process of installing Flarum

Official Installation Documentation

    1. Create the good one site under the AMH Control Panel (designated as a site here), and do a good job of resolving the domain name to confirm the normal access
    2. Delete all files under the A site
    3. Create a MySQL database for good one flarum and the corresponding user
    4. SSH into the A site root directory (cd/home/wwwroot/environment/domain/primary domain/web/)
    5. Execute installation command: Composer Create-project Flarum/flarum. --stability=beta
    6. Configure the Nginx configuration file for site A (/home/wwwroot/environment/vhost/primary domain name. conf): See the official installation documentation. Special Note: The parameters under Location ~* \.php$ are automatically generated, and you need to delete the configuration information for the automatically generated errorpage.
    7. Overload Nginx and access a site, fill in the relevant installation information. (for file read/write permission issues, see the issue highlights below)

Install Flarum Chinese Language Pack

For ease of operation, we install the Chinese Language pack for the default language switch.

Several installation methods have been attempted, and the command line installation is recommended here:

    1. SSH down to the a site root directory
    2. Execute composer require Jsthon/flarum-ext-simplified-chinese
    3. Visit a site, go to the background to modify the Chinese extension, and modify the default language.

Other languages and extensions: Https://discuss.flarum.org/d/1534-extension-list

Problem Collection

Problems you may encounter:

-bash PHP Command not found

Composer installation and use of the PHP-CLI way, AMH support multiple versions of PHP, environment variables do not specify the PHP-CLI version, here we need to add the specified version of PHP into the environment variables.

Add in ~/.bash_profile:

Path= $PATH:/usr/local/php-version/binexport PATH

After saving the changes, execute the source ~/.bash_profile so that the changes take effect.

PS: If you are using other distributions of Linux, please search yourself how to set PHP to add to environment variables.

Requires Ext-fileinfo * or request for Intervention/image

See:

    • Http://stackoverflow.com/questions/24850136/i-have-ext-fileinfo-but-composer-says-it-is-missing
    • Http://amh.sh/bbs/post-6149-1-1.htm

To put it simply, the PHP extension we installed in the AMH did not affect the php-cli way of running PHP configuration, we need to manually synchronize the configuration:

cp/home/wwwroot/Environment/etc/amh-php.ini/usr/local/php-Version/etc/php.ini

Heavy-duty Nginx can take effect.

chmod this directory to 0775

When you visit a site installed through composer, encountered similar permissions read and write problems, for the AMH environment, we need to do:

sudo chown www:www-r/home/wwwroot/environment/domain/primary Domain/web

Here are some discussions:

    • Https://discuss.flarum.org/d/823-directorys-are-not-writable/46
    • Https://discuss.flarum.org/d/2209-directory-not-writable/3

The above discussion uses the user group and AMH not the same, the AMH website user Group is WWW, the actual situation can really solve the problem.

Other

View our results: Cafeting's Forum

Official documents adapted to the latest version of Flarum, recommended

Chinese documents are older and have some reference meanings

The AMH integration environment has a lot of differences compared to the usual direct installation environment, and it is important to consider when using it.

If there is any problem, you can leave a message under the blog or contact me by the following way:

You can focus on my Github, Csdn and Weibo

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.