Skip to content

Environment Variables Reference

Complete reference of environment variables supported by Phexium applications.

Core Settings

Variable Values Default Description
slim.environment development, testing, production development Application environment
config.dir config/demo, config/starter - Configuration directory to load

Error Handling

Variable Values Default Description
error.handler whoops, builtin whoops Error handler type
error.builtin.displayErrorDetails true, false true Display error details (disable in production)
error.builtin.logErrors true, false false Log errors to error log
error.builtin.logErrorDetails true, false false Include error details in logs

Logger

Variable Values Default Description
logger.type file, null null Logger implementation
logger.level emergency, alert, critical, error, warning, notice, info, debug debug Minimum log level
logger.file.path File path /var/log/app.log Log file location (when logger.type = file)

Database

Variable Values Default Description
database.type InMemory, Sqlite, Mysql, Postgresql Sqlite Database implementation

SQLite Configuration

Variable Description
database.sqlite.fullpath Path to SQLite database file (relative to project root)

MySQL Configuration

Variable Default Description
database.mysql.host - MySQL server hostname
database.mysql.port 3306 MySQL server port
database.mysql.dbname - Database name
database.mysql.user - Database user
database.mysql.password - Database password
database.mysql.charset utf8mb4 Connection charset

PostgreSQL Configuration

Variable Default Description
database.postgresql.host - PostgreSQL server hostname
database.postgresql.port 5432 PostgreSQL server port
database.postgresql.dbname - Database name
database.postgresql.user - Database user
database.postgresql.password - Database password

Session

Variable Values Default Description
session.type native, odan-php, odan-memory odan-memory Session implementation

NativeSession Configuration

These settings apply when session.type = native:

Variable Default Description
session.native.name phexium_app Session cookie name

OdanSession Configuration

These settings apply when session.type = odan-php or odan-memory:

Variable Default Description
session.odan.name phexium_app Session cookie name
session.odan.lifetime 7200 Session lifetime in seconds
session.odan.path / Cookie path
session.odan.domain `` Cookie domain
session.odan.secure false HTTPS-only cookie
session.odan.httponly true HTTP-only cookie (prevents JavaScript access)
session.odan.samesite Lax SameSite attribute (Lax, Strict, None)

Cache

Variable Values Default Description
cache.type null, memory, file, redis null Cache implementation

File Cache Configuration

These settings apply when cache.type = file:

Variable Default Description
cache.file.path /var/cache/phexium Cache directory path

Redis Cache Configuration

These settings apply when cache.type = redis:

Variable Default Description
cache.redis.host redis Redis server hostname
cache.redis.port 6379 Redis server port

Example Configuration

Development

slim.environment = "development"
config.dir = "config/demo"

error.handler = "whoops"

logger.type = "file"
logger.level = "debug"
logger.file.path = "/var/log/php/phexium.log"

database.type = "Sqlite"
database.sqlite.fullpath = "database/sqlite.db"

cache.type = "memory"

session.type = "odan-php"
session.odan.name = "phexium_dev"

Production

slim.environment = "production"
config.dir = "config/demo"

error.handler = "builtin"
error.builtin.displayErrorDetails = "false"
error.builtin.logErrors = "true"

logger.type = "file"
logger.level = "warning"
logger.file.path = "/var/log/php/phexium.log"

database.type = "Mysql"
database.mysql.host = "db.example.com"
database.mysql.dbname = "phexium_prod"
database.mysql.user = "app_user"
database.mysql.password = "secure_password"

cache.type = "redis"
cache.redis.host = "redis.example.com"
cache.redis.port = 6379

session.type = "odan-php"
session.odan.secure = true
session.odan.httponly = true
session.odan.samesite = "Strict"

Source Files

  • env.sample - Example configuration template
  • config/demo/container.php - Environment variable usage in DI container