Skip to content
On this page


Server Requirements

Before you install Fresns, it's important to check that your server meets the requirements. To run Fresns, you will need:

Web ServerNginx or Apache or IIS or Caddy
Package ManagerComposer 2.5 or higher
Code LangPHP 8.1 or higher
DatabaseMySQL 5.7 or 8.x

PHP Config Requirements

  • Extensions: fileinfo
  • Functions: putenv symlink proc_open passthru


  • Latest Version: v2.7.2 (2023-03-05)

Option 1: Download the full package manually

Option 2: Download via Composer

  • Download the program
composer create-project fresns/fresns
  • Configuration Manager
php artisan vendor:publish --provider="Fresns\PluginManager\Providers\PluginServiceProvider"
php artisan vendor:publish --provider="Fresns\ThemeManager\Providers\ThemeServiceProvider"
php artisan vendor:publish --provider="Fresns\MarketManager\Providers\MarketServiceProvider"


1. Config the Web Server

Note: As the “website root directory” is not the “main program root directory”, the website will request the main program root directory file upwards when running, so please do not turn on the function configuration of anti-cross-site attack (open_basedir).

2. Install Config

  • Access {website}/install
  • Check the environment and configure the database information according to the process
  • Fill in the administrator information and register an administrator account
  • Login Panel {website}/fresns/admin

Config Intro

Task Scheduling

When running Fresns, you need a way to keep “scheduled tasks” running normally, and task scheduling of Laravel framework is a mechanism to ensure that main programs and plug-ins can use scheduled tasks. With task scheduling configured, the main program can regularly clean up and log off accounts and detect the expiration of user roles.

# Task Config
* * * * * cd /your-project-path && php artisan schedule:run >> /dev/null 2>&1
# or
su -c "cd /your-project-path && php artisan schedule:run >> /dev/null 2>&1" -s /bin/sh owner

# Example
* * * * * cd /www/wwwroot/fresns && php artisan schedule:run >> /dev/null 2>&1
# or
su -c "cd /www/wwwroot/fresns && php artisan schedule:run >> /dev/null 2>&1" -s /bin/sh www

.env Config File

After successful installation, there will be an .env file in the root directory of the main program, which is used to store all the configuration information of Fresns. The details are as follows:

APP_ENV=production          #Operating environment, local for test use, production for official operation
APP_KEY=Encryption Key      #Data encryption key, which can be regenerated with the command php artisan key:generate
APP_DEBUG=false             #Whether to output detailed error messages
APP_URL=Main Program URL    #example
APP_FOUNDER=1               #Founder Account ID (accounts->id)

DB_CONNECTION=mysql           #Database Type
DB_HOST=             #Default is
DB_PORT=3306                  #Default is 3306
DB_DATABASE=fresns            #Database
DB_USERNAME=fresns            #Username
DB_PASSWORD=123456            #Password
DB_TIMEZONE=Asia/Singapore    #Database Timezone
DB_PREFIX=fs_                 #Default is fs_

Trusted Proxies

If you are running as a proxy, you need to configure .env trusted IP information, multiple separated by English commas.

Let's take the Cloudflare proxy environment as an example and configure IPv4 and IPv6

# IPv4

# IPv6

# or All

Cache Config

You may specify which cache driver you would like to be used by default throughout your application. Fresns supports popular caching backends like Memcached, Redis, DynamoDB, and relational databases out of the box. In addition, a file based cache driver is available, while array and null cache drivers provide convenient cache backends for your automated tests.

  • The default caching system is File, if you want to change it, we recommend Redis or Memcached caching.
  • Before you can change the cache configuration, you must install the appropriate PHP extension and then modify the `.env' file to include the cache configuration.


In addition to cache, other driver systems that support Redis can also be configured to use it.




Memcached only supports drive cache and session.



Timezone Config

Fresns is a software that supports cross-time zone service. To ensure the consistency of time values, UTC time zone standard is adopted in the software.

Input time

  • Considering the reason of the framework, the time zone option in the configuration file .env DB_TIMEZONE can only be based on PHP time zone function, which is named after the region.
  • The time entered the database from the framework will be processed into the time zone time configured by .env DB_TIMEZONE, that bypasses the framework will be processed into the database time zone by the database (the database time zone is usually the system time zone of the server where the database is located). Therefore, the time zone in the configuration file must be consistent with that in the database in order to ensure the accuracy of time.
  • The installation function of Fresns will randomly pair a PHP time zone function according to the UTC time zone you selected. If it does not conform to your region, please modify it in the .env file yourself. For example, Beijing, Shanghai, Singapore and Western Australia are all UTC+8 time zones, and any one of them can meet the standard.
  • In the background, you can check the UTC time zone of your database in the “Dashboard” system information.

Output time

  • Fresns will automatically determine the UTC time zone of the database, and then output the time according to the client’s request.
  • When there is no request from the client, the “Default Time Zone” set in “Site Settings” will be output by default. For example, if the database time zone is UTC+8 and the default time zone set by the site is UTC-7, the database time will be converted to UTC-7 by default when the client does not file a request.
  • Requirement logic for the client time zone: when logging in, the user-defined time zone is preferred; If not logged in or not set by the user, the system time zone of the user’s device (computer or mobile phone) is obtained. If no system time zone is obtained, it will be based on the default time zone set by the site.

URL Rewriting

Make sure your Web server directs all requests to the public/index.php directory file, and never try to move the index.php file to the main program root directory. This is because running the program from the main program root directory will expose many sensitive files to the public Internet, which is a very unsafe way to run.


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


<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes

    RewriteEngine On

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Send Requests To Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]


        <rule name="Imported Rule 1" stopProcessing="true">
          <match url="^(.*)/$" ignoreCase="false" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
          <action type="Redirect" redirectType="Permanent" url="/{R:1}" />
        <rule name="Imported Rule 2" stopProcessing="true">
          <match url="^" ignoreCase="false" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
          <action type="Rewrite" url="index.php" />


rewrite {
    to {path} {path}/ /index.php?{query}

Directory Structure

fresns/         // Main Program Root Directory
├── app/            // Core Code Directory
├── bootstrap/      // Bootstrap Framework Directory
├── config/         // Configuration File Directory
├── database/       // Data File Directory
├── extensions/     // Extensions Directory
│   ├── plugins/
│   ├── themes/
│   └── backups/
├── public/         // Website Root Directory
│   ├── assets/         // Extension Static Files
│   ├── static/         // Built-in Static Files
│   ├── index.php       // Website Entrance File
│   ├── favicon.ico     // Site ico Icon
│   └── robots.txt      // Search Engine Robots Protocol
├── resources/      // Framework Resource Directory
├── storage/        // Framework Storage Directory
├── vendor/         // Packages Directory
├── .env            // Configuration File (generated after installation is complete)
├── artisan         // Framework Command File
├── compose.json    // Package Config
├── compose.lock    // Package Installation Info
├── fresns.json     // Fresns Config
├── install.lock    // Installation Lock File (after having this file, it is forbidden to execute the installation again)
└── LICENSE         // Copyright Documents

Folder Ownership

During installation, Fresns may request that you make certain directories writable. To allow write access to a directory on Linux, execute the following command:

chmod 755 /path/to/directory

If Fresns requests write access to both the directory and its contents, you need to add the -R flag so that the permissions are updated for all the files and folders within the directory:

chmod 755 -R /path/to/directory

If after completing these steps, Fresns continues to request that you change the permissions you may need to check that your files are owned by the correct group and user.


Your environment may vary from the documentation provided, please consult your web server configuration or web hosting provider for the proper user and group that PHP and the web server operate under.


You should never set any folder or file to permission level 777, as this permission level allows anyone to access the content of the folder and file regardless of user or group.

Released under the Apache-2.0 License