diff --git a/CHANGELOG.md b/CHANGELOG.md index 90a6660f..0d92bac0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Add `TZ` env var to change PHP `date.timezone` (#133) - Update to PHP 8.2 (#411) - Add back a `/sessions` volume for sessions persistence (#399) +- Support adding custom configurations in `/etc/phpmyadmin/conf.d` (#401) ## [5.2.1] - 2023-02-08 diff --git a/README.md b/README.md index 9b1b8efd..6aa0571e 100644 --- a/README.md +++ b/README.md @@ -136,6 +136,16 @@ See the following links for config file information: * https://docs.phpmyadmin.net/en/latest/config.html#config * https://docs.phpmyadmin.net/en/latest/setup.html +## Adding custom configuration in `/etc/phpmyadmin/conf.d` + +you can also consider storing your custom configuration files in the folder `/etc/phpmyadmin/conf.d`, which is very suitable for managing multiple phpMyAdmin configuration files for different hosts,Then you can create `server-1.php`, `server-2.php`, or any file name you want, and store them in the conf.d directory mounted on the host. + +On the `docker run` line like this: + +```sh +docker run --name phpmyadmin -d --link mysql_db_server:db -p 8080:80 -v /some/local/directory/conf.d:/etc/phpmyadmin/conf.d:ro phpmyadmin:latest +``` + ## Usage behind a reverse proxy Set the variable ``PMA_ABSOLUTE_URI`` to the fully-qualified path (``https://pma.example.net/``) where the reverse proxy makes phpMyAdmin available. diff --git a/apache/config.inc.php b/apache/config.inc.php index 8055e5c9..9a391347 100644 --- a/apache/config.inc.php +++ b/apache/config.inc.php @@ -159,3 +159,10 @@ if (file_exists('/etc/phpmyadmin/config.user.inc.php')) { include '/etc/phpmyadmin/config.user.inc.php'; } + +/* Support additional configurations */ +if (is_dir('/etc/phpmyadmin/conf.d/')) { + foreach (glob('/etc/phpmyadmin/conf.d/*.php') as $filename) { + include $filename; + } +} diff --git a/config.inc.php b/config.inc.php index 8055e5c9..9a391347 100644 --- a/config.inc.php +++ b/config.inc.php @@ -159,3 +159,10 @@ if (file_exists('/etc/phpmyadmin/config.user.inc.php')) { include '/etc/phpmyadmin/config.user.inc.php'; } + +/* Support additional configurations */ +if (is_dir('/etc/phpmyadmin/conf.d/')) { + foreach (glob('/etc/phpmyadmin/conf.d/*.php') as $filename) { + include $filename; + } +} diff --git a/fpm-alpine/config.inc.php b/fpm-alpine/config.inc.php index 8055e5c9..9a391347 100644 --- a/fpm-alpine/config.inc.php +++ b/fpm-alpine/config.inc.php @@ -159,3 +159,10 @@ if (file_exists('/etc/phpmyadmin/config.user.inc.php')) { include '/etc/phpmyadmin/config.user.inc.php'; } + +/* Support additional configurations */ +if (is_dir('/etc/phpmyadmin/conf.d/')) { + foreach (glob('/etc/phpmyadmin/conf.d/*.php') as $filename) { + include $filename; + } +} diff --git a/fpm/config.inc.php b/fpm/config.inc.php index 8055e5c9..9a391347 100644 --- a/fpm/config.inc.php +++ b/fpm/config.inc.php @@ -159,3 +159,10 @@ if (file_exists('/etc/phpmyadmin/config.user.inc.php')) { include '/etc/phpmyadmin/config.user.inc.php'; } + +/* Support additional configurations */ +if (is_dir('/etc/phpmyadmin/conf.d/')) { + foreach (glob('/etc/phpmyadmin/conf.d/*.php') as $filename) { + include $filename; + } +}