php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #81253 unexpected result of setting env[LC_MESSAGES] in php-fpm pool config
Submitted: 2021-07-12 17:08 UTC Modified: 2021-12-15 18:24 UTC
From: php at wb9 dot se Assigned: bukka (profile)
Status: Re-Opened Package: FPM related
PHP Version: 7.4.21 OS: FreeBSD
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: php at wb9 dot se
New email:
PHP Version: OS:

 

 [2021-07-12 17:08 UTC] php at wb9 dot se
Description:
------------
Tested on FreeBSD 13 with PHP Version 7.4.21 from ports.

Configure line:  './configure' '--with-layout=GNU' '--with-config-file-scan-dir=/usr/local/etc/php' '--disable-all' '--with-libxml' '--with-password-argon2=/usr/local' '--program-prefix=' '--enable-mysqlnd' '--enable-fpm' '--with-fpm-user=www' '--with-fpm-group=www' '--enable-embed' '--enable-dtrace' '--prefix=/usr/local' '--localstatedir=/var' '--mandir=/usr/local/man' '--infodir=/usr/local/share/info/' '--build=amd64-portbld-freebsd13.0' 'build_alias=amd64-portbld-freebsd13.0' 'PKG_CONFIG=pkgconf' 'CFLAGS=-O2 -pipe -fstack-protector-strong -fno-strict-aliasing ' 'CPP=cpp' 'CXXFLAGS=-O2 -pipe -fstack-protector-strong -fno-strict-aliasing ' 

Setting env[LC_MESSAGES] = C.UTF-8 in the www php-fpm pool config sets results in "6" => "C.UTF8" in the $_SERVER array.

Test script:
---------------
phpinfo();

Expected result:
----------------
$_SERVER["LC_MESSAGES"] => "C.UTF-8"

Actual result:
--------------
$_SERVER["6"] => "C.UTF8"

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-08-01 06:48 UTC] dc dot link at yahoo dot fr
Is this bug occuring with PHP 8 ?
 [2021-11-28 20:44 UTC] bukka@php.net
-Status: Open +Status: Duplicate
 [2021-11-28 20:44 UTC] bukka@php.net
This is because the environment variables are not currently supported in the FPM configuration. This is a duplicate of https://bugs.php.net/bug.php?id=76798
 [2021-11-28 20:44 UTC] bukka@php.net
-Assigned To: +Assigned To: bukka
 [2021-12-03 12:11 UTC] php at wb9 dot se
1. I have not tried this with php 8 yet.

2. #76798 is about configuring php *using* environment variables, while in this case I try to *define* environment variables in the php-fpm context. Other locale-related variables work (such as LANG or LC_PAPER), but so far I've found that LC_ALL and LC_MESSAGES does not work; instead I get the environment keys "0" and "6".
 [2021-12-15 18:24 UTC] bukka@php.net
-Status: Duplicate +Status: Re-Opened
 [2021-12-15 18:24 UTC] bukka@php.net
Ah ok I see - this is a bit different issue.
 [2023-07-31 11:25 UTC] udvgydsgv644 at gmail dot com
Such a fascinating article on a lovely day like today; thank you for your efforts in creating such a beneficial article. (https://github.com.php)(https://www.survey.onl/tflatslistens-smg-com/)
 [2024-04-14 17:19 UTC] vantomas at vantomas dot net
Hello,

If you encounter this issue, I was able to resolve it by modifying the fpm .conf file. Instead of using:

env[LC_ALL] = cs_CZ.UTF-8

I defined it with quotes around the variable name:

env["LC_ALL"] = cs_CZ.UTF-8

It appears that LC_ALL might be defined as a constant elsewhere, and enclosing it in quotes makes it function as expected.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 11:01:30 2024 UTC