Intermittent failures of gettext() with php-fpm
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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