You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Thomas Bartosik <Th...@goeg.at> on 2021/11/08 18:28:35 UTC

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: Add Contributing file? (was Re: unwanted setlocale() interaction between mod_php and mod_perl2)

Posted by Steve Hay <st...@googlemail.com>.
On Tue, 23 Nov 2021 at 16:39, Edward J. Sabol <ed...@gmail.com> wrote:
>
> On Nov 23, 2021, at 3:34 AM, Steve Hay <st...@googlemail.com> wrote:
>
> 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.

Now updated here: http://svn.apache.org/viewvc?view=revision&revision=1896119

> While you are modifying the README, could you add a CONTRIBUTING or CONTRIBUTING.md or Contributing.pod file as well? This would make it so that the "How to Contribute" link in the left sidebar on the metacpan.org page would display something useful. Personally, this is always the first link I check when I want to submit a patch or issue on something Perl-related. Compare https://metacpan.org/dist/mod_perl/contribute to https://metacpan.org/dist/DBD-Pg/contribute, e.g. This file should document how to check out the source code repository, how and where to submit patches, where to file issues, etc. I think it would be extremely useful, and it doesn't need to be anything elaborate. You could just copy https://raw.githubusercontent.com/bucardo/dbdpg/master/CONTRIBUTING.md and make some edits to that.
>
>

Now added here: http://svn.apache.org/viewvc?view=revision&revision=1896120

RC2 on its way shortly.

Add Contributing file? (was Re: unwanted setlocale() interaction between mod_php and mod_perl2)

Posted by "Edward J. Sabol" <ed...@gmail.com>.
On Nov 23, 2021, at 3:34 AM, Steve Hay <st...@googlemail.com> wrote:
> 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.

While you are modifying the README, could you add a CONTRIBUTING or CONTRIBUTING.md or Contributing.pod file as well? This would make it so that the "How to Contribute" link in the left sidebar on the metacpan.org page would display something useful. Personally, this is always the first link I check when I want to submit a patch or issue on something Perl-related. Compare https://metacpan.org/dist/mod_perl/contribute to https://metacpan.org/dist/DBD-Pg/contribute, e.g. This file should document how to check out the source code repository, how and where to submit patches, where to file issues, etc. I think it would be extremely useful, and it doesn't need to be anything elaborate. You could just copy https://raw.githubusercontent.com/bucardo/dbdpg/master/CONTRIBUTING.md and make some edits to that.

Thanks,
Ed


Re: unwanted setlocale() interaction between mod_php and mod_perl2

Posted by Steve Hay <st...@googlemail.com>.
On Mon, 8 Nov 2021 at 18:28, Thomas Bartosik <Th...@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.