chore(php-fpm): update the default locale setting.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
This commit is contained in:
Bo-Yi Wu 2019-12-11 14:28:14 +08:00
parent fb617deb86
commit a1d7d46573
4 changed files with 13 additions and 0 deletions

View File

@ -1500,6 +1500,13 @@ To add locales to the container:
4 - Check enabled locales with `docker-compose exec php-fpm locale -a` 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`
<br> <br>

View File

@ -212,6 +212,7 @@ services:
- INSTALL_XHPROF=${PHP_FPM_INSTALL_XHPROF} - INSTALL_XHPROF=${PHP_FPM_INSTALL_XHPROF}
- PUID=${PHP_FPM_PUID} - PUID=${PHP_FPM_PUID}
- PGID=${PHP_FPM_PGID} - PGID=${PHP_FPM_PGID}
- LOCALE=${PHP_FPM_DEFAULT_LOCALE}
- http_proxy - http_proxy
- https_proxy - https_proxy
- no_proxy - no_proxy

View File

@ -206,6 +206,7 @@ PHP_FPM_INSTALL_SSHPASS=false
PHP_FPM_INSTALL_MAILPARSE=false PHP_FPM_INSTALL_MAILPARSE=false
PHP_FPM_FFMPEG=false PHP_FPM_FFMPEG=false
PHP_FPM_ADDITIONAL_LOCALES="es_ES.UTF-8 fr_FR.UTF-8" PHP_FPM_ADDITIONAL_LOCALES="es_ES.UTF-8 fr_FR.UTF-8"
PHP_FPM_DEFAULT_LOCALE=POSIX
PHP_FPM_PUID=1000 PHP_FPM_PUID=1000
PHP_FPM_PGID=1000 PHP_FPM_PGID=1000

View File

@ -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 \ echo "/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1" > /etc/ld.so.preload \
;fi ;fi
# Configure locale.
ARG LOCALE=POSIX
ENV LC_ALL ${LOCALE}
WORKDIR /var/www WORKDIR /var/www
CMD ["php-fpm"] CMD ["php-fpm"]