php / php/php-src

Intermittent failures of gettext() with php-fpm

Open
#12,624 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug Extension: gettext Status: Needs Triage
Dominant language
C
Stars
40.4k
Forks
8.1k
Avg merge
2d 13h
Merged PRs (30d)
96

Description

Description

The following code:

<?php
echo setlocale(LC_MESSAGES, 'de_DE.UTF-8');
bindtextdomain('edas', '/mnt/edas/html/locale');

echo _("Good morning");

The page will sometimes generate the correct result, sometimes just produce the key - without any code or .mo changes. Restarting php-fpm or apache (or rebooting) does not help. The Linux function gettext shows the correct result.

PHP Version

PHP 8.2.9

Operating System

AWS Linux 2 (Centos)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the supplied PHP snippet with gettext(), setlocale(), bindtextdomain(), and php-fpm on PHP 8.2.9 under AWS Linux 2. Compare intermittent translations with the Linux gettext result and document the conditions that distinguish the correct translation from the key. Done means the failure is consistently reproduced or its cause is identified and covered by an appropriate regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend, localization
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.