# Source installation

TIP

This document takes the Baota Panel 8.0.4 version and CentOS 8.5 system source code to install the BeikeShop system as an example.

# Installation environment requirements

  1. PHP 8.1+

  2. MySQL 5.7+

  3. Apache httpd 2.4+ or Nginx 1.10+

  4. Nodejs 14+

Prerequisites:

  • The PHP version installed in the Baota panel must be 8.1 or above, and the MySQL version must be MySQL 5.7 or above
  • The Baota panel has installed Apache httpd 2.4+ or Nginx 1.10+
  • Successfully logged into the Baota console

# Installation Steps

Step 1: Configure PHP Installing the extension

TIP

The BeikeShop system relies on the fileinfo extension to run. After Baota installs PHP, the fileinfo extension is not installed by default. You need to configure PHP before deployment. The following operations will guide you to install the fileinfo extension

  1. In the Baota console, click [Software Store] -> [Installed] to find the installed PHP software. As shown in the figure below

img

  1. Click to select the PHP software name you want to use for the BeikeShop system (must be 8.1 or above). Here we take PHP-8.1 as an example.

img

  1. In the pop-up [PHP Management] window, click [Install Extension] to install the extension settings. As shown in the figure below

img

  1. Select [fileinfo] and click [Install]. As shown below:

img

5.Wait for the installation to complete

Deleting a function

TIP

The BeikeShop system needs to delete the disabled functions putenv and proc_open, and PHP needs to be configured before deployment. The following operations will guide you to delete the disabled functions

  1. In the [PHP Management] window, click [Disable Function] to enter the disabled function setting page, as shown below:

img

  1. In the function list, click [Delete] function putenv, proc_open to delete the disabled function.

Step 2: Create a site

  1. In the Baota console, click [Website] -> [Add Site]. As shown in the following figure:

img

  1. In the pop-up Add Website window, enter the relevant configuration information. As shown below

img

TIP

Domain name: Enter the domain name bound to the BeikeShop system.
Make sure that the bound domain name has been added with relevant resolution.
Remarks: Optional, you can add the website's remarks.
Root directory: The website file root directory. Generally, the default /www/wwwroot path is used.
FTP: Optional, you can create an FTP service. Not created by default.
Database: Optional, you can create a database in your server for use. The database type must be MySQL 5.7 and above. If you need to create a database in the server for use, please select [MySQL] [utf8mb4] and enter the database username and password.
Program type: PHP, not selectable by default.
PHP version: Please select the configured PHP version.
Website category: Default category. You can choose according to the actual situation.

3.Click [Submit]. The site will be created.

Step 3: Get the source code for configuration

TIP

  • Git has been installed on the host
  • Composer version 2.0 or above, composer is installed by default after installing PHP in Baota version 8.0.4
  • Nodejs 14+ has been installed on the host
  1. The server enters the /www/wwwroot/test.beike.shop directory, test.beike.shop is the site directory, whichever is more appropriate
cd /www/wwwroot/test.beike.shop
  1. Clone the source code
git clone https://gitee.com/beikeshop/beikeshop.git
  1. Enter the beikeshop directory in the command line and execute composer install to install third-party packages
cd beikeshop

composer install
  1. Then execute cp .env.example .env to create the configuration file
cp .env.example .env
  1. Then execute npm install and npm run dev to compile the front-end js and css files
npm install

npm run dev
  1. Set public in the project folder as the website root directory

In the Baota console, click [Website], select the created BeikeShop site, and click [Settings]. As shown in the following figure:

img

In the pop-up site modification window, click [Website Directory] to make relevant settings for the website directory. As shown in the figure below:

img

The website directory is set to:/www/wwwroot/test.beike.shop/beikeshop

The run directory is set to:/public

Remove the option to prevent cross-site attacks

img

# Nginx
  1. Nginx environment pseudo-static configuration (this step can be omitted if Apache is used)

In the Baota console, click [Website], select the created BeikeShop site, and click [Settings]. As shown in the following figure:

img

In the pop-up site modification window, click [Website Directory] to make relevant settings for the website directory. As shown in the figure below:

img

Enter the following content in the text box. As shown in the figure

location / {

 try_files $uri $uri/ /index.php?$query_string;

}

img

You can also edit directly in the corresponding file (the file name is domain.conf). As shown below:

alt alt
  1. Change the permissions of the storge, public directories, and .env files to 755 or 777

Step 4: System Installation

Enter the domain name test.beikeshop.com in the browser, and if the interface shown in the figure appears, you have successfully entered the installation page.

alt

Click Check Requirements, Check Permissions, and Configure Environment buttons in sequence. Installation Finished.

Step 1: Install the interface

alt

Step 2: Environmental Check

alt

Step 3: Directory permission check

alt

Step 4: Fill in the database, backend login user information and click the Install button

alt

Note: The Set admin account password information column will appear only after the Database system passes the automatic detection.

Step 5: If the installation is successful, the page shown in the figure will appear.

alt

Mall interface

Front-end interface

img

Backstage interface img

TIP

This is the end of the installation tutorial. You can use the system now!
If you have any other questions, please contact [email protected] / QQ:9358972

# Frequently asked questions

1.When executing composer install, an error is encountered as shown in the following figure

img img

Solution: Delete the disabled functions putenv and proc_open

  1. When executing composer install, an error is encountered as shown in the following figure

img

Solution: Install the fileinfo extension

  1. Use Nginx as a web service, configure the site and the page will display 404 when it is opened for the first time
    Solution: Configure pseudo-static
location / {

 try_files $uri $uri/ /index.php?$query_string;

}
  1. An error occurs as shown in the figure

img

Solution: Execute composer install in the code root directory

  1. There is a page style error, as shown in the figure

img

Solution: Execute npm install && npm run dev in the code root directory

6.An error occurs as shown in the figure

img

or

img

Solution: Change the storage directory permissions to 755 or 777

7.After the installation system fills in the database information and retrieves it, an error appears as shown in the figure by clicking Install.

img

or

img

Solution: Change the .env file permissions to 755 or 777

  1. After the system is installed, enter the mall homepage and report a 500 error or the error shown in the figure

img

or

img

Solution: Change the permissions of the public directory to 755 or 777