From a1d7d46573ad5b87c098a1e8181e878236a891f7 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Wed, 11 Dec 2019 14:28:14 +0800 Subject: [PATCH] chore(php-fpm): update the default locale setting. Signed-off-by: Bo-Yi Wu --- DOCUMENTATION/content/documentation/index.md | 7 +++++++ docker-compose.yml | 1 + env-example | 1 + php-fpm/Dockerfile | 4 ++++ 4 files changed, 13 insertions(+) diff --git a/DOCUMENTATION/content/documentation/index.md b/DOCUMENTATION/content/documentation/index.md index 399db68e..1e8f6c5b 100644 --- a/DOCUMENTATION/content/documentation/index.md +++ b/DOCUMENTATION/content/documentation/index.md @@ -1500,6 +1500,13 @@ To add locales to the container: 4 - Check enabled locales with `docker-compose exec php-fpm locale -a` +Update the locale setting, default is `POSIX` + +1 - Open the `.env` file and set `PHP_FPM_DEFAULT_LOCALE` to `en_US.UTF8` or other locale you want. + +2 - Re-build your PHP-FPM Container `docker-compose build php-fpm`. + +3 - Check the default locale with `docker-compose exec php-fpm locale`
diff --git a/docker-compose.yml b/docker-compose.yml index 7c469df4..fc73a321 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -212,6 +212,7 @@ services: - INSTALL_XHPROF=${PHP_FPM_INSTALL_XHPROF} - PUID=${PHP_FPM_PUID} - PGID=${PHP_FPM_PGID} + - LOCALE=${PHP_FPM_DEFAULT_LOCALE} - http_proxy - https_proxy - no_proxy diff --git a/env-example b/env-example index d5388433..e6ee7989 100644 --- a/env-example +++ b/env-example @@ -206,6 +206,7 @@ PHP_FPM_INSTALL_SSHPASS=false PHP_FPM_INSTALL_MAILPARSE=false PHP_FPM_FFMPEG=false PHP_FPM_ADDITIONAL_LOCALES="es_ES.UTF-8 fr_FR.UTF-8" +PHP_FPM_DEFAULT_LOCALE=POSIX PHP_FPM_PUID=1000 PHP_FPM_PGID=1000 diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile index 042341f3..3333114f 100644 --- a/php-fpm/Dockerfile +++ b/php-fpm/Dockerfile @@ -835,6 +835,10 @@ RUN if [ ${INSTALL_FAKETIME} = true ]; then \ echo "/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1" > /etc/ld.so.preload \ ;fi +# Configure locale. +ARG LOCALE=POSIX +ENV LC_ALL ${LOCALE} + WORKDIR /var/www CMD ["php-fpm"]