Mailing List Archive

unwanted setlocale() interaction between mod_php and mod_perl2
Hi!

Up until Ubuntu 18.04 LTS or Debian 9, a perl service (eprints.org) and a PHP service (nextcloud) worked smoothly next to each other on Apache with mod_php and mod_perl2.

However, on Ubuntu 20.04 LTS, or Debian 10, as soon as I enable mod_perl2, setlocale() on nextcloud does not seem to work anymore.

The relevant versions are

Apache 2.4.29 and mod_perl2 2.0.10, mod_php7.2 7.2.24 vs.
Apache 2.4.41 and mod_perl2 2.0.11, mod_php7.4 7.4.3

This issue is already documented at least in two locations that I know of:

https://bugs.php.net/bug.php?id=81596
https://bugs.mageia.org/show_bug.cgi?id=25411

The first one states that setlocale() in PHP does not work anymore globally, so this does not seem to be a nextcloud specific issue, but some kind of general interaction problem, as it seems mod_perl2 somehow manipulates the process' locale in an unchangeable way.

I tried hard to find a bug tracker for mod_perl2 but have not been successful till now, so please excuse if there is one and this is already documented (and please give me a link)!

Any insight is appreciated.

Thanks in advance!
th
Re: unwanted setlocale() interaction between mod_php and mod_perl2 [ In reply to ]
On Mon, 8 Nov 2021 at 18:28, Thomas Bartosik <Thomas.Bartosik@goeg.at> wrote:
>
> Hi!
>
> Up until Ubuntu 18.04 LTS or Debian 9, a perl service (eprints.org) and a PHP service (nextcloud) worked smoothly next to each other on Apache with mod_php and mod_perl2.
>
> However, on Ubuntu 20.04 LTS, or Debian 10, as soon as I enable mod_perl2, setlocale() on nextcloud does not seem to work anymore.
>
> The relevant versions are
>
> Apache 2.4.29 and mod_perl2 2.0.10, mod_php7.2 7.2.24 vs.
> Apache 2.4.41 and mod_perl2 2.0.11, mod_php7.4 7.4.3
>
> This issue is already documented at least in two locations that I know of:
>
> https://bugs.php.net/bug.php?id=81596
> https://bugs.mageia.org/show_bug.cgi?id=25411
>
> The first one states that setlocale() in PHP does not work anymore globally, so this does not seem to be a nextcloud specific issue, but some kind of general interaction problem, as it seems mod_perl2 somehow manipulates the process' locale in an unchangeable way.
>
> I tried hard to find a bug tracker for mod_perl2 but have not been successful till now, so please excuse if there is one and this is already documented (and please give me a link)!
>
> Any insight is appreciated.
>

Apologies for the slow response.

A comment dated 2021-11-09 11:54 UTC on the first bug report that you
cited suggests that it's unlikely to be anything that's changed
recently in mod_perl that is to blame, though that doesn't rule out
some existing nastiness that has been exposed by changes in something
else.

The mod_perl bug tracker is
https://rt.cpan.org/Dist/Display.html?Name=mod_perl, which can be
accessed from the "Issues" link in the left-hand menu at the
metacpan.org page, https://metacpan.org/pod/mod_perl2. (I think you
need to log in to an account on rt.cpan.org to actually report bugs
there.) This probably ought to be documented better somewhere. I will
add a note to the README file at least.

Looking at the list of current bugs I see only this one mentioning
locale issues: https://rt.cpan.org/Ticket/Display.html?id=133553,
although it sounds like something different.