Frequently Asked Questions

Execution Logic

  • The admin framework concept is simple: M (model) only handles database table connections (can perform related data processing based on business logic)

  • Write middleware or service layer according to your business needs

  • Main focus on C (controller) -> V (view) -> JS (controller-specific JS)

Every controller has a corresponding JS file (directory: /public/static/admin/js/controller_name.js)

Installation Errors and Suggestions (pay attention to bold colors)

  • Check that the php version is >=8.2, recommended 8.5+. (EasyAdmin8-Laravel requires 8.3 or above)

  • Check that the composer version is >=2.0, verify that the php version bound to composer matches the above requirements using: composer show --platform, scroll to the last line to check

  • MySQL version >= 5.7, recommended 8.0+ Other versions may work but have not been tested, use at your own discretion

  • The pdo extension must be enabled, otherwise installation will fail

  • If composer install fails, try using composer install --ignore-platform-reqs

  • If certain package versions cannot be found during composer install, check the composer source. It is recommended to use the Tencent Cloud Mirror or the official mirror. Avoid using the Alibaba Cloud mirror

  • If the installation page shows errors, check that the database credentials are correct. For different server systems (Windows, MacOS, Linux), ensure the relevant folders have proper read/write permissions

  • If the installation page keeps redirecting to itself after completion, check whether the install.lock file exists at config/install/lock. If not, run chown -R www:www /www/wwwroot/EasyAdmin8 (where /www/wwwroot/EasyAdmin8 is your project path)

  • If the page returns 404 after successful installation, check whether php-fpm has URL rewriting configured, mainly for ThinkPHP and Laravel versions

  • Although different EasyAdmin8 versions have the same database structure, there are slight differences in internal data values. Do not share databases across versions; keep them separate during installation and .env configuration

  • Do not manually import sql files to install the database - it is not needed. After setting up the project, simply visit the homepage to configure and install the database automatically!

  • If the initial loading speed feels too slow, check the APP_DEBUG setting in .env. Toggle this setting based on your understanding of the respective framework

  • Recommended essential extensions: opcache, event, enable jit

  • If you need the file upload feature, check that the php version has the fileinfo extension installed

  • Strongly recommended: Unless absolutely necessary, do NOT do NOT do NOT set any directory or file permissions to 777. Use chown + chmod appropriately to configure project permissions

  • After modifying the admin path, clear the system cache via the admin page top-right corner or visit xxx.com/adminXyz/ajax/clearCache, replacing with your own domain, where adminXyz is your new admin path

  • Refer to the example modules included in the default installation, such as the product management module and system log module

Casual Talk

Don't argue every day about which language or framework is better - languages and frameworks will outlive you. Use that time to write a few elegant bugs instead.

We're already in the AI era, and people are still debating which language to use?

No matter the language or framework, if it helps you make money, it's a good one!

Detailed Usage - More Documentation

Click to view documentation

View common examples

How to Enable JIT

  • Default php configuration file is php.ini
# First confirm that opcache is installed
zend_extension=opcache

# Add four lines under the [opcache] section
opcache.enable=1
opcache.enable_cli=1
opcache.jit_buffer_size=128M
opcache.jit=1255
// Test to check if `on` is `true`

var_dump(opcache_get_status()['jit']);

Project File Permission Configuration

  • It is recommended not to set folder permissions to 777 in any development process or any language, unless there is a particularly unreasonable requirement

  • Project folder permissions can be configured as follows (replace with your own directory path in production)

chown  -R  www:www /wwww/wwwroot/EasyAdmin8
chmod  -R  755 /wwww/wwwroot/EasyAdmin8

EasyAdmin8 Version (ThinkPHP)

  • Domain binding must point to public

  • URL rewriting configuration

location / {

        if ( !-e $request_filename){
    
            rewrite ^/(.*)$ /index.php?s=$1 last;
    
            break;
    
        }
    
    } 

EasyAdmin8-Laravel Version (Laravel)

  • Domain binding must point to public

  • Global routes are in routes/web.php

  • URL rewriting configuration

 location / {

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

}

EasyAdmin8-webman Version (webman)

  • This version provides different branches for different development preferences: choose the main branch if you prefer Laravel, or the thinkphp branch if you prefer ThinkPHP

  • If you encounter {"code":-1,"msg":"访问地址异常"}, add EASYADMIN.ADMIN_DOMAIN_STATUS and EASYADMIN.ADMIN_DOMAIN to .env (refer to .example.env), then run composer require webman/domain (This feature allows custom admin access URLs, see Custom Domain Configuration)

  • Disabled Function Check