Skip to content

Commit a1d7d46

Browse files
committed
chore(php-fpm): update the default locale setting.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
1 parent fb617de commit a1d7d46

4 files changed

Lines changed: 13 additions & 0 deletions

File tree

DOCUMENTATION/content/documentation/index.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,6 +1500,13 @@ To add locales to the container:
15001500

15011501
4 - Check enabled locales with `docker-compose exec php-fpm locale -a`
15021502

1503+
Update the locale setting, default is `POSIX`
1504+
1505+
1 - Open the `.env` file and set `PHP_FPM_DEFAULT_LOCALE` to `en_US.UTF8` or other locale you want.
1506+
1507+
2 - Re-build your PHP-FPM Container `docker-compose build php-fpm`.
1508+
1509+
3 - Check the default locale with `docker-compose exec php-fpm locale`
15031510

15041511

15051512
<br>

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ services:
212212
- INSTALL_XHPROF=${PHP_FPM_INSTALL_XHPROF}
213213
- PUID=${PHP_FPM_PUID}
214214
- PGID=${PHP_FPM_PGID}
215+
- LOCALE=${PHP_FPM_DEFAULT_LOCALE}
215216
- http_proxy
216217
- https_proxy
217218
- no_proxy

env-example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ PHP_FPM_INSTALL_SSHPASS=false
206206
PHP_FPM_INSTALL_MAILPARSE=false
207207
PHP_FPM_FFMPEG=false
208208
PHP_FPM_ADDITIONAL_LOCALES="es_ES.UTF-8 fr_FR.UTF-8"
209+
PHP_FPM_DEFAULT_LOCALE=POSIX
209210

210211
PHP_FPM_PUID=1000
211212
PHP_FPM_PGID=1000

php-fpm/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -835,6 +835,10 @@ RUN if [ ${INSTALL_FAKETIME} = true ]; then \
835835
echo "/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1" > /etc/ld.so.preload \
836836
;fi
837837

838+
# Configure locale.
839+
ARG LOCALE=POSIX
840+
ENV LC_ALL ${LOCALE}
841+
838842
WORKDIR /var/www
839843

840844
CMD ["php-fpm"]

0 commit comments

Comments
 (0)