application/config/config.php. This guide explains every configuration option available.
Configuration File Overview
The config file uses PHP constants defined withdefine() for configuration values:
application/config/config.php
Constants are used instead of variables because they cannot be accidentally changed during runtime, making your application more secure and predictable.
Environment Settings
Error Reporting
Control how PHP errors are displayed:application/config/config.php
- Development
- Production
- Shows all errors and warnings
- Displays errors directly on the page
- Useful for debugging during development
Error Reporting Levels
URL Configuration
MINI automatically detects your application’s URL structure:application/config/config.php
Understanding URL Components
URL_PUBLIC_FOLDER
URL_PUBLIC_FOLDER
The name of the public folder that contains Default:
index.php.publicChange if: You renamed the public folderURL_PROTOCOL
URL_PROTOCOL
The protocol part of the URL.Default:
// (protocol-independent)The // notation automatically uses:http://for non-SSL connectionshttps://for SSL connections
URL_DOMAIN
URL_DOMAIN
The domain name from the HTTP request.Auto-detected examples:
localhostlocalhost:8000example.comwww.example.com
URL_SUB_FOLDER
URL_SUB_FOLDER
Automatically detects if your app is in a subdirectory.Examples:
| Installation | URL_SUB_FOLDER |
|---|---|
http://localhost/ | / |
http://localhost/myapp/ | /myapp/ |
http://example.com/ | / |
http://example.com/app/ | /app/ |
URL (Complete URL)
URL (Complete URL)
The final, complete base URL for your application.Auto-generated examples:
//localhost///localhost/myapp///example.com///www.example.com/app/
Using the URL Constant
TheURL constant is used throughout MINI for creating links:
Common URL Configurations
- Local Development
- Subdirectory Installation
- Production (Auto)
- Production (Manual)
Database Configuration
Database connection settings:application/config/config.php
Database Settings Explained
DB_TYPE - Database Type
DB_TYPE - Database Type
The PDO driver to use for database connection.Supported values:
mysql- MySQL or MariaDB (most common)pgsql- PostgreSQLsqlite- SQLite
DB_HOST - Database Server
DB_HOST - Database Server
The hostname or IP address of your database server.Common values:
127.0.0.1- Local MySQL serverlocalhost- Local MySQL server (socket connection)mysql- Docker container namedb.example.com- Remote database server192.168.1.100:3307- Custom port
DB_NAME - Database Name
DB_NAME - Database Name
The name of the database to connect to.Must match the database you created during installation.
DB_USER - Database Username
DB_USER - Database Username
The username for database authentication.Production example:
DB_PASS - Database Password
DB_PASS - Database Password
The password for database authentication.
DB_CHARSET - Character Encoding
DB_CHARSET - Character Encoding
The character set for database communication.Recommended values:
utf8- Standard UTF-8 (good for most use cases)utf8mb4- Full UTF-8 support including emojis
Environment-Specific Database Config
Use different database settings for development vs production:application/config/config.php
Complete Configuration Examples
Development Environment
application/config/config.php
Production Environment
application/config/config.php
Docker Environment
application/config/config.php
Security Best Practices
Don't commit credentials to version control
Don't commit credentials to version control
Add Create a template file instead:
config.php to .gitignore:.gitignore
application/config/config.example.php
Use environment variables
Use environment variables
Store sensitive data in environment variables:Set in your server environment:
application/config/config.php
Restrict file permissions
Restrict file permissions
Make config.php readable only by the web server:
Use strong database passwords
Use strong database passwords
Generate secure passwords:
Accessing Configuration Values
Configuration constants are available throughout your application:Database constants (DB_HOST, DB_USER, etc.) are only used in
application/core/controller.php for the PDO connection. You typically don’t access them elsewhere.Troubleshooting
Links don't work / 404 errors
Links don't work / 404 errors
Problem: URLs are incorrect or missing the base path.Solution: Check URL configuration:Verify
.htaccess is present in the public folder.Database connection fails
Database connection fails
Problem: Cannot connect to database.Solution: Verify credentials:
Errors not showing in development
Errors not showing in development
Problem: Error reporting not working.Solution: Check php.ini settings:
Next Steps
Database Setup
Learn how to set up and use the database
CRUD Operations
Implement Create, Read, Update, Delete functionality
