Configuration
Plugi is configured through two files:
.env — Environment-specific database, stage, admin-login, and mail settings.
config.php — PHP array that controls framework behavior, modules, themes, and extensions; copy it from config.dist.php for a fresh checkout.
The .env File
The .env file is loaded from the project root by EnvLoader at boot time. Start with .env.dist and use the exact variable names below:
| Variables |
Purpose |
STAGE, BASE_URL |
Select the application stage and public URL. Set the stage to production for a deployed site. |
DATABASE_DRIVER, DATABASE_HOST, DATABASE_DATABASE, DATABASE_USERNAME, DATABASE_PASSWORD, DATABASE_CHARSET, DATABASE_PREFIX |
Database connection settings read by DB. Use DATABASE_HOST=mysql only when connecting to the supplied Compose service. |
USERNAME, PASSWORD_HASH, PASSWORD |
Admin login read by the Auth module. Prefer PASSWORD_HASH; PASSWORD is a legacy plaintext fallback. |
MAIL_HOST, MAIL_PORT, MAIL_ENCRYPTION, MAIL_USERNAME, MAIL_PASSWORD, MAIL_FROM_ADDRESS, MAIL_FROM_NAME, MAIL_TIMEOUT |
SMTP settings mapped from the environment into the existing mail configuration by config.php / config.dist.php. |
MYSQL_ROOT_PASSWORD is only used by the local Compose database container; it is not the application's database password. Keep .env private and never commit it.
Setting STAGE=production disables PHP error display in index.php.
The config.php File
Copy config.dist.php to config.php and adjust the settings. The configuration is a PHP array with the following sections:
General Settings
| Key |
Description |
language |
Default language code (e.g., en, de, fr). Theme and extension translations are loaded for this language. |
assets_url |
Public URL path to the Plugi core assets (JS, CSS, images). |
uploads_url |
Public URL path to the uploads directory. |
Storage Settings
| Key |
Description |
use_database |
Set to true to use MySQL for storing pages, settings, and uploads metadata. |
uploads_folder |
Absolute filesystem path where uploaded files are stored. |
Auth Settings
| Key |
Description |
use_login |
Enable or disable the built-in authentication module. |
class |
Fully qualified class name implementing AuthContract. |
url |
URL prefix for auth endpoints (login/logout). |
The default Auth class reads USERNAME and either PASSWORD_HASH or the legacy PASSWORD value from .env; credentials are not configured in the PHP auth array. Use a password hash for deployments and leave PASSWORD empty.
Website Manager Settings
| Key |
Description |
use_website_manager |
Enable or disable the admin dashboard. |
class |
Class implementing WebsiteManagerContract. |
url |
URL prefix for the admin panel. |
Page Builder Settings
| Key |
Description |
class |
Class implementing PageBuilderContract (GrapesJS-based by default). |
url |
URL prefix for the page builder. |
actions |
Named action URLs, e.g., back returns to the admin panel. |
Page Settings
| Key |
Description |
class |
Class implementing PageContract. |
table |
Database table name for pages. |
translation.class |
Class implementing PageTranslationContract. |
translation.table |
Database table name for page translations (multilingual support). |
translation.foreign_key |
Foreign key column linking translations to pages. |
Cache Settings
| Key |
Description |
enabled |
Enable page caching. Cached pages skip block parsing on subsequent requests. |
folder |
Filesystem path for cache files. |
class |
Class implementing CacheContract. |
A page is cached unless it contains a block with caching disabled. The cache is automatically cleared when a page is saved in the page builder. You can also force a cache refresh by appending ?refresh_cache to the URL.
Theme Settings
| Key |
Description |
class |
Class implementing ThemeContract. |
folder |
Filesystem path to the themes directory. |
folder_url |
Public URL path to the themes directory. |
active_theme |
Slug of the active theme (matches a folder name in themes/). |
Router Settings
| Key |
Description |
class |
Class implementing RouterContract that resolves URLs to pages. |
Class Replacements
Map a core class namespace to an alternative implementation. This allows overriding specific classes while extending the originals. Example:
Important: When overriding a class, always extend the original class.