Feature Language Change Composer Dependency Changed PR-6.1-dev Pending

User tests: Successful: Unsuccessful:

avatar Fedik
Fedik
11 Jan 2026

Pull Request for Issue #36898 .

Alternative to PR #45523 .

Summary of Changes

This is complete (I hope) implementation of environment variables in Joomla.

This version uses Symfony\Dotenv component which have an ability to use php file for the environment variables caching. Which should improve security and boot speed. Also provides CLI commands for dump .env to php file, and for debugging of existing variables.

Compared to vlucas/phpdotenv used in #45523 Symfony\Dotenv lacks of customization (like custom Parser etc) but we probably will not bee need it any time soon.

Key points:

  • By default the feature is disabled. Create .env (or .env.local.php) in root folder to enable it. Or for CLI run command as JOOMLA_ENV=test php cli/joomla.php foobar-comand
  • I tried to keep the variable names in sync with Joomla Docker. If you find something is missing or a typo, please let me know.
  • The installation can be completed with environment variables (except language part). This work with CLI and WEB installer. User can provide all options via environment variables (including admin user info) or a few (like DB only, then installer will ask for missing options).
  • The configuration options provided by environment variables cannot be edited in backend, also via CLI.
  • The default JOOMLA_ENV is prod. In this state .env file is not allowed and must be used .env.local.php instead. During installation of prod environment installer will dump .env to .env.local.php and remove .env.

New CLI commands:

  • php cli/joomla.php config-dotenv:dump compiles .env files into a PHP-optimized file .env.local.php
  • php cli/joomla.php config-dotenv:debug displays all the environment variables configured by dotenv.

Testing Instructions

Test installation, test with Web and in CLI installer

  1. Create .env with DB options:
JOOMLA_DB_TYPE="mysql"
JOOMLA_DB_HOST="Your DB host"
JOOMLA_DB_USER="Your DB user"
JOOMLA_DB_PASSWORD="Your DB password"
JOOMLA_DB_NAME="Your db name"
JOOMLA_DB_PREFIX="DB prefix"

And run installer. You should be asked for Site name, and User information.
Then installation should be completed, as usual.

  1. Create .env with all installation parameters and user information:
JOOMLA_DB_TYPE="mysql"
JOOMLA_DB_HOST="Your DB host"
JOOMLA_DB_USER="Your DB user"
JOOMLA_DB_PASSWORD="Your DB password"
JOOMLA_DB_NAME="Your db name"
JOOMLA_DB_PREFIX="DB prefix"

JOOMLA_SITE_NAME="Test installation"
JOOMLA_PUBLIC_FOLDER=""

JOOMLA_ADMIN_USER="Your admin user"
JOOMLA_ADMIN_USERNAME="Your admin username"
JOOMLA_ADMIN_PASSWORD="Your admin user password"
JOOMLA_ADMIN_EMAIL="Your admin user email"

And run installer. You will not be asked for Site name, and User information.
The installation should be completed, as usual.

Test the existing site

Create .env.local.php with DB options, and copy options from configuration.php.
(skip this step if the site was installed with use of .env)

<?php

return [
  'JOOMLA_DB_TYPE' => 'mysql',
  'JOOMLA_DB_HOST' => 'Your DB host',
  'JOOMLA_DB_USER' => 'Your DB user',
  'JOOMLA_DB_PASSWORD' => 'Your DB password',
  'JOOMLA_DB_NAME' => 'Your db name',
  'JOOMLA_DB_PREFIX' => 'DB prefix',
];

Then visit the site, all should work as before.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:
  • No documentation changes for docs.joomla.org needed
  • Pull Request link for manual.joomla.org: TBD
  • No documentation changes for manual.joomla.org needed
avatar Fedik Fedik - open - 11 Jan 2026
avatar Fedik Fedik - change - 11 Jan 2026
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 11 Jan 2026
Category Repository Administration com_config Language & Strings External Library Composer Change Installation JavaScript Libraries
avatar Fedik Fedik - change - 11 Jan 2026
Labels Added: Feature Language Change Composer Dependency Changed PR-6.1-dev

Add a Comment

Login with GitHub to post a comment