An update from the bug reportee. I've been able to reproduce this bug using the following Dockerfile:
```
FROM debian:buster
RUN apt-get update && \
apt-get install -y --no-install-recommends \
apache2 \
locales \
libapache2-mod-perl2 \ # toggle this line to witness the bug
libapache2-mod-php7.3
RUN echo "nl_NL ISO-8859-1\nnl_NL.UTF-8 UTF-8\n" > /etc/locale.gen &&
locale-gen && locale -a
RUN rm -f /var/www/html/index.html && \
echo "<?php\necho setlocale(LC_ALL, 'nl_NL') . PHP_EOL .
strftime('%A %e %B %Y', time());\n" >
/var/www/html/index.php
CMD /usr/sbin/apache2ctl -D FOREGROUND
EXPOSE 80
```
Apparently it's the combination of mod-perl2 and mod-php7.3 that's
causing the setlocale() to fail.
To test, save the above lines as a Dockerfile, run `docker build -t
locale-test . && docker run -it -p "80:80" locale-test` and go to
http://localhost
When libapache2-mod-perl2 is installed it outputs "nl_NL Friday 26 July
2019", when not installed it outputs "nl_NL vrijdag 26 juli 2019".
Should the package of this bug report be changed?
Regards,
Filidor Wiese
On 24-07-19 10:19, Fili wrote:
> Package: libapache2-mod-php7.3
> Version: 7.3.4-2
> Severity: important
>
> Dear Maintainer,
>
> Setup:
>
> I have two hosts, one up-to-date Debian Stretch with PHP 7.0, the
> other up-to-date Debian Buster with PHP 7.3. Both have (near to)
> identical configuration of PHP, Apache and locales.
>
> Problem:
>
> When running the following php script on 7.3 within a browser the
> setlocale() line does not seem to take effect:
>
> <?php
> echo setlocale(LC_ALL, 'nl_NL'); // Output is as expected: nl_NL
>
> echo strftime("%A %e %B %Y", mktime(0, 0, 0, 12, 22, 1978));
>
> /**
> * Output on 7.0 cli/browser: vrijdag 22 december 1978
> * Output on 7.3 cli: vrijdag 22 december 1978
> * Output on 7.3 browser: Friday 22 December 1978
> **/
> ?>
>
> On PHP 7.3 within the browser the output is not translated. It does
> however work as expected when run on the CLI. On Debian Stretch it
> works appropriately on both the browser and cli.
>
> $ locale -a
> C
> C.UTF-8
> dutch
> en_US.utf8
> nl_NL
> nl_NL.iso88591
> nl_NL.utf8
> POSIX
>
> $ cat /etc/default/locale # File generated by update-locale
> LANG="en_US.UTF-8"
> LANGUAGE="en_US:en"
>
> $ cat /etc/apache2/mods-enabled/mpm_*
> LoadModule mpm_itk_module /usr/lib/apache2/modules/mpm_itk.so
> <IfModule mpm_prefork_module>
> StartServers 5
> MinSpareServers 5
> MaxSpareServers 10
> MaxRequestWorkers 150
> MaxConnectionsPerChild 0
> </IfModule>
> LoadModule mpm_prefork_module /usr/lib/apache2/modules/mod_mpm_prefork.so
>
>
> -- Package-specific info:
> ==== Additional PHP 7.3 information ====
>
> ++++ PHP 7.3 SAPI (php7.3query -S): ++++
>
> ++++ PHP 7.3 Extensions (php7.3query -M -v): ++++
>
> ++++ Configuration files: ++++
> [PHP]
> engine = On
> short_open_tag = On
> precision = 14
> output_buffering = 4096
> zlib.output_compression = Off
> implicit_flush = Off
> unserialize_callback_func =
> serialize_precision = -1
> disable_functions =
> pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
> disable_classes =
> zend.enable_gc = On
> expose_php = Off
> max_execution_time = 360
> max_input_time = 60
> memory_limit = 128M
> error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
> display_errors = Off
> display_startup_errors = Off
> log_errors = On
> log_errors_max_len = 1024
> ignore_repeated_errors = Off
> ignore_repeated_source = Off
> report_memleaks = On
> html_errors = On
> error_log = php_errors.log
> arg_separator.input = ";&"
> variables_order = "EGPCS"
> request_order = "GP"
> register_argc_argv = Off
> auto_globals_jit = On
> post_max_size = 33M
> auto_prepend_file =
> auto_append_file =
> default_mimetype = "text/html"
> default_charset = "UTF-8"
> doc_root =
> user_dir =
> enable_dl = Off
> file_uploads = On
> upload_max_filesize = 32M
> max_file_uploads = 20
> allow_url_fopen = On
> allow_url_include = Off
> default_socket_timeout = 60
> [CLI Server]
> cli_server.color = On
> [Date]
> date.timezone = "Europe/Amsterdam"
> [filter]
> [iconv]
> [imap]
> [intl]
> [sqlite3]
> sqlite3.defensive = 1
> [Pcre]
> [Pdo]
> [Pdo_mysql]
> pdo_mysql.default_socket=
> [Phar]
> [mail function]
> SMTP = localhost
> smtp_port = 25
> mail.add_x_header = On
> [ODBC]
> odbc.allow_persistent = Off
> odbc.check_persistent = On
> odbc.max_persistent = -1
> odbc.max_links = -1
> odbc.defaultlrl = 4096
> odbc.defaultbinmode = 1
> [Interbase]
> ibase.allow_persistent = 1
> ibase.max_persistent = -1
> ibase.max_links = -1
> ibase.timestampformat = "%Y-%m-%d %H:%M:%S"
> ibase.dateformat = "%Y-%m-%d"
> ibase.timeformat = "%H:%M:%S"
> [MySQLi]
> mysqli.max_persistent = -1
> mysqli.allow_persistent = Off
> mysqli.max_links = -1
> mysqli.default_port = 3306
> mysqli.default_socket =
> mysqli.default_host =
> mysqli.default_user =
> mysqli.default_pw =
> mysqli.reconnect = Off
> [mysqlnd]
> mysqlnd.collect_statistics = On
> mysqlnd.collect_memory_statistics = Off
> [OCI8]
> [PostgreSQL]
> pgsql.allow_persistent = On
> pgsql.auto_reset_persistent = Off
> pgsql.max_persistent = -1
> pgsql.max_links = -1
> pgsql.ignore_notice = 0
> pgsql.log_notice = 0
> [bcmath]
> bcmath.scale = 0
> [browscap]
> [Session]
> session.save_handler = files
> session.save_path = "/shared/tmp/php7.3"
> session.use_strict_mode = 0
> session.use_cookies = 1
> session.use_only_cookies = 1
> session.name = PHPSESSID
> session.auto_start = 0
> session.cookie_lifetime = 0
> session.cookie_path = /
> session.cookie_domain =
> session.cookie_httponly =
> session.cookie_samesite =
> session.serialize_handler = php
> session.gc_probability = 0
> session.gc_divisor = 1000
> session.gc_maxlifetime = 1440
> session.referer_check =
> session.cache_limiter = nocache
> session.cache_expire = 180
> session.use_trans_sid = 0
> session.sid_length = 26
> session.trans_sid_tags = "a=href,area=href,frame=src,form="
> session.sid_bits_per_character = 5
> [Assertion]
> zend.assertions = -1
> [COM]
> [mbstring]
> [gd]
> [exif]
> [Tidy]
> tidy.clean_output = Off
> [soap]
> soap.wsdl_cache_enabled=1
> soap.wsdl_cache_dir="/tmp"
> soap.wsdl_cache_ttl=86400
> soap.wsdl_cache_limit = 5
> [sysvshm]
> [ldap]
> ldap.max_links = -1
> [dba]
> [opcache]
> [curl]
> [openssl]
>
> **** /etc/php/7.3/apache2/conf.d/20-pdo_mysql.ini ****
> extension=pdo_mysql.so
>
> **** /etc/php/7.3/apache2/conf.d/15-xml.ini ****
> extension=xml.so
>
> **** /etc/php/7.3/apache2/conf.d/20-curl.ini ****
> extension=curl.so
>
> **** /etc/php/7.3/apache2/conf.d/10-pdo.ini ****
> extension=pdo.so
>
> **** /etc/php/7.3/apache2/conf.d/10-mysqlnd.ini ****
> extension=mysqlnd.so
>
> **** /etc/php/7.3/apache2/conf.d/20-bcmath.ini ****
> extension=bcmath.so
>
> **** /etc/php/7.3/apache2/conf.d/20-ftp.ini ****
> extension=ftp.so
>
> **** /etc/php/7.3/apache2/conf.d/20-xmlreader.ini ****
> extension=xmlreader.so
>
> **** /etc/php/7.3/apache2/conf.d/20-exif.ini ****
> extension=exif.so
>
> **** /etc/php/7.3/apache2/conf.d/20-imap.ini ****
> extension=imap.so
>
> **** /etc/php/7.3/apache2/conf.d/20-sysvmsg.ini ****
> extension=sysvmsg.so
>
> **** /etc/php/7.3/apache2/conf.d/20-odbc.ini ****
> extension=odbc.so
>
> **** /etc/php/7.3/apache2/conf.d/20-intl.ini ****
> extension=intl.so
>
> **** /etc/php/7.3/apache2/conf.d/20-mysqli.ini ****
> extension=mysqli.so
>
> **** /etc/php/7.3/apache2/conf.d/20-readline.ini ****
> extension=readline.so
>
> **** /etc/php/7.3/apache2/conf.d/10-opcache.ini ****
> zend_extension=opcache.so
>
> **** /etc/php/7.3/apache2/conf.d/20-gd.ini ****
> extension=gd.so
>
> **** /etc/php/7.3/apache2/conf.d/20-ctype.ini ****
> extension=ctype.so
>
> **** /etc/php/7.3/apache2/conf.d/20-fileinfo.ini ****
> extension=fileinfo.so
>
> **** /etc/php/7.3/apache2/conf.d/20-recode.ini ****
> extension=recode.so
>
> **** /etc/php/7.3/apache2/conf.d/20-simplexml.ini ****
> extension=simplexml.so
>
> **** /etc/php/7.3/apache2/conf.d/20-xmlwriter.ini ****
> extension=xmlwriter.so
>
> **** /etc/php/7.3/apache2/conf.d/20-tokenizer.ini ****
> extension=tokenizer.so
>
> **** /etc/php/7.3/apache2/conf.d/20-soap.ini ****
> extension=soap.so
>
> **** /etc/php/7.3/apache2/conf.d/20-pdo_sqlite.ini ****
> extension=pdo_sqlite.so
>
> **** /etc/php/7.3/apache2/conf.d/20-gettext.ini ****
> extension=gettext.so
>
> **** /etc/php/7.3/apache2/conf.d/20-posix.ini ****
> extension=posix.so
>
> **** /etc/php/7.3/apache2/conf.d/20-shmop.ini ****
> extension=shmop.so
>
> **** /etc/php/7.3/apache2/conf.d/20-sqlite3.ini ****
> extension=sqlite3.so
>
> **** /etc/php/7.3/apache2/conf.d/20-wddx.ini ****
> extension=wddx.so
>
> **** /etc/php/7.3/apache2/conf.d/20-sysvsem.ini ****
> extension=sysvsem.so
>
> **** /etc/php/7.3/apache2/conf.d/20-phar.ini ****
> extension=phar.so
>
> **** /etc/php/7.3/apache2/conf.d/20-dom.ini ****
> extension=dom.so
>
> **** /etc/php/7.3/apache2/conf.d/20-zip.ini ****
> extension=zip.so
>
> **** /etc/php/7.3/apache2/conf.d/20-sysvshm.ini ****
> extension=sysvshm.so
>
> **** /etc/php/7.3/apache2/conf.d/20-mbstring.ini ****
> extension=mbstring.so
>
> **** /etc/php/7.3/apache2/conf.d/20-json.ini ****
> extension=json.so
>
> **** /etc/php/7.3/apache2/conf.d/20-sockets.ini ****
> extension=sockets.so
>
> **** /etc/php/7.3/apache2/conf.d/20-iconv.ini ****
> extension=iconv.so
>
> **** /etc/php/7.3/apache2/conf.d/20-calendar.ini ****
> extension=calendar.so
>
> **** /etc/php/7.3/apache2/conf.d/20-pdo_odbc.ini ****
> extension=pdo_odbc.so
>
> **** /etc/php/7.3/apache2/conf.d/20-xsl.ini ****
> extension=xsl.so
>
>
> -- System Information:
> Debian Release: 10.0
> APT prefers stable
> APT policy: (500, 'stable')
> Architecture: amd64 (x86_64)
>
> Kernel: Linux 4.19.0-5-amd64 (SMP w/8 CPU cores)
> Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8),
> LANGUAGE=en_US:en (charmap=UTF-8)
> Shell: /bin/sh linked to /bin/dash
> Init: systemd (via /run/systemd/system)
> LSM: AppArmor: enabled
>
> Versions of packages libapache2-mod-php7.3 depends on:
> ii apache2-bin [apache2-api-20120211] 2.4.38-3
> ii libargon2-1 0~20171227-0.2
> ii libc6 2.28-10
> ii libmagic1 1:5.35-4
> ii libpcre2-8-0 10.32-5
> ii libsodium23 1.0.17-1
> ii libssl1.1 1.1.1c-1
> ii libxml2 2.9.4+dfsg1-7+b3
> ii mime-support 3.62
> ii php7.3-cli 7.3.4-2
> ii php7.3-common 7.3.4-2
> ii php7.3-json 7.3.4-2
> ii php7.3-opcache 7.3.4-2
> ii tzdata 2019a-1
> ii ucf 3.0038+nmu1
> ii zlib1g 1:1.2.11.dfsg-1
>
> Versions of packages libapache2-mod-php7.3 recommends:
> ii apache2 2.4.38-3
>
> Versions of packages libapache2-mod-php7.3 suggests:
> pn php-pear <none>
>
> Versions of packages php7.3-common depends on:
> ii libc6 2.28-10
> ii libssl1.1 1.1.1c-1
> ii php-common 2:69
> ii ucf 3.0038+nmu1
>
> -- no debconf information
signature.asc
Description: OpenPGP digital signature

