Find framework reference pages for handlers, routes, middleware, modules, database, views, and security.

Environment Variables

CorianderPHP loads simple runtime variables from .env.

When .env is missing and .env-example exists, the framework copies .env-example to .env before loading variables. The generated .env file is ignored by Git.

Supported Syntax

APP_ENV=local
APP_DEBUG=1
APP_TIMEZONE=Europe/Paris
PROJECT_URL=http://localhost
PUBLIC_URL_PREFIX=

Supported:

  • empty lines
  • comments starting with #
  • KEY=value
  • export KEY=value
  • single-quoted values
  • double-quoted values with \n, \r, \t, \", and \\
  • inline comments after unquoted values, such as APP_ENV=local # comment

The loader does not parse complex shell syntax, arrays, multiline values, or variable expansion.

Override Behavior

The 0.4.1 starter defaults to APP_ENV=production and APP_DEBUG=0. The example above deliberately enables local debugging. Existing .env files are not rewritten on framework updates; choose safe values explicitly for a public deployment.

Existing server or shell environment variables are not overwritten by .env.

This keeps production deployment variables in control while preserving a simple local developer workflow.