From nobody Mon Sep 30 19:55:23 2024 X-Original-To: freebsd-questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XHWyc2y7pz5Xb0V for ; Mon, 30 Sep 2024 19:55:36 +0000 (UTC) (envelope-from gaberalasmy@gmail.com) Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XHWyc11jPz4Bsc for ; Mon, 30 Sep 2024 19:55:36 +0000 (UTC) (envelope-from gaberalasmy@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-qt1-x836.google.com with SMTP id d75a77b69052e-4581d2b0fbaso35945221cf.1 for ; Mon, 30 Sep 2024 12:55:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727726135; x=1728330935; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=DPjK7Qq6HLTG/7yHBDvAa1SWdjsHf/QPNw1mfvaXbY0=; b=fP45ZA3E6ISLhg7ma+TQbvUkRxtHnLEEF6LpC5gGHjQa/HqyoKscq3kVGWa77+4xaw q4H8hYP5llYuujnJFp7z0f0LcpHaf6aTtxJ9N6/BV/ZNq1o7AQ+JJ54yurrp2RgXHeBa nfz2h6u8lPkpwERRPXpHtm7qqavJjJB7BZ33ABXKCMB2Lr3H3hJg4YDSV7mxjptdh9Ik gL9ZE7HRv3tyb6DSgn8tWX32vzMciCd+4KAt5yzw0U5QpfrIRLRftTujvLSE3XOMVm1q Y8xv9n/hR07jvro/9fTDwYDRkEE4Lew0LgSzuFuDGyPRyvryoYenreISw8gpJUKiN/f3 MaIw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727726135; x=1728330935; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=DPjK7Qq6HLTG/7yHBDvAa1SWdjsHf/QPNw1mfvaXbY0=; b=jUXJOdPiHRYLBhzY/TYaCe3B9ES0nZDHODiuTLryIszImNW5/v8xZflweGfPe/Ofl0 s2sl4QgA2+HdoxTSMPN8mSnCAhfJFaTjDpJTUSvuazLntg2XNM+KrL63S2DkvuHNWETq Bg3t+SYpZTL64o0EklOpwIiBIRAmypD5Xnc2gKWluDLioXhSEWBG4c097EWRp8KhvAyO hrGn9Y7qRA+hdzYqXRZhNDTmUrHvaSACzx/QZXzkrgQEwaaxW3qdaWIIER8fTEg/XFNA 9/BhmqRtsIqJ9AjZczQrL80Q/5kH253PMTyrpckrZuB+jxGfKLm+bYjeODUfjlmpmf14 +FJA== X-Gm-Message-State: AOJu0Yy57/T2OdzXAWm4M4CAw7TuIfn99/XV6swESVAeXvBBbd1HhKok Ji3FnBYjyNu1C/UBzj2CYa7W700Jk0lxZJek/N8SBPWfM69geUHJUmwnwX/iRZVxpwAji5OIQCA 02/7P/XzBZmgGYzGImIOe9nnmrdHVyw== X-Google-Smtp-Source: AGHT+IHqlaCvf/MB+GJtRiFvcobr7nXTCk6aJpvi2LEXZZoRxYVTGS1brjncxKmhtXwKiO9dYJdnHZNQKO+IwGVDJFs= X-Received: by 2002:a05:622a:5b0a:b0:45d:5d32:613d with SMTP id d75a77b69052e-45d5d32618fmr78120021cf.24.1727726134675; Mon, 30 Sep 2024 12:55:34 -0700 (PDT) List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-questions@freebsd.org Sender: owner-freebsd-questions@FreeBSD.org MIME-Version: 1.0 References: In-Reply-To: From: =?UTF-8?B?2KfYqNmIINio2YbYr9ixINin2YTYudi12YrZhdmK?= Date: Mon, 30 Sep 2024 22:55:23 +0300 Message-ID: Subject: Re: Issue with MediaWiki Installation: IntlException and Locale Problems in Apache To: Marius Schamschula Cc: freebsd-questions@freebsd.org, Adrian Gschwend Content-Type: multipart/alternative; boundary="00000000000086cee106235b9607" X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4XHWyc11jPz4Bsc X-Spamd-Bar: ---- --00000000000086cee106235b9607 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Peace be upon you. I have a Garmin device and the OpenSeaMap map (UTF-8) does not work. Please help. =D9=81=D9=8A =D8=A7=D9=84=D8=A7=D8=AB=D9=86=D9=8A=D9=86=D8=8C =D9=A3=D9=A0 = =D8=B3=D8=A8=D8=AA=D9=85=D8=A8=D8=B1 =D9=A2=D9=A0=D9=A2=D9=A4, =D9=A1=D9=A0= :=D9=A2=D9=A7 =D9=85 Marius Schamschula < lists@schamschula.com> =D9=83=D8=AA=D8=A8: > On Sep 30, 2024, at 1:39=E2=80=AFPM, Adrian Gschwend = wrote: > > Hi group, > > I'm trying to install MediaWiki on FreeBSD with Apache and PHP 8.1 via > mod_php, but I keep running into an issue related to the `Intl` extension > and locale settings. During the MediaWiki installation process, I get the > following error: > > ``` > IntlException: Constructor failed > ``` > > There are no errors in the Apache log, and I have doublechecked that the > `Intl` extension is enabled and working in CLI PHP. When I run the same > code via Apache, it throws an exception. > > I created a minimal PHP test case to see if I could reproduce the error > outside of MediaWiki. Here's the test script: > > ``` > > // Set the locale to test > $locale =3D 'en_US.UTF-8'; > > // Check if Intl extension is loaded > if (!extension_loaded('intl')) { > die("Intl extension is not loaded!\n"); > } > > // Display the current locale settings > echo "Current locale: " . setlocale(LC_ALL, 0) . "\n"; > > // Test the Intl NumberFormatter > try { > $formatter =3D new NumberFormatter($locale, NumberFormatter::DECIMAL); > echo "Number formatting test: " . $formatter->format(12345.67) . "\n"; > } catch (Exception $e) { > echo "IntlException: " . $e->getMessage() . "\n"; > } > ?> > > ``` > > Results: > > - Command Line PHP: > > ``` > Current locale: C/C.UTF-8/C/C/C/C > Number formatting test: 12,345.67 > ``` > > - Apache (via browser): > > ``` > Current locale: C/C.UTF-8/C/C/C/C > IntlException: Constructor failed > ``` > > So the same script works on the same jail on cli but not in Apache with > mod_php. > > What I've Tried > > - I have set `LANG` and `LC_ALL` to `en_US.UTF-8` in both the Apache > environment and PHP=E2=80=99s `php.ini`. > - I verified that the `Intl` extension is loaded in both CLI and Apache > environments. > - `phpinfo()` reports the correct locale in Apache (`en_US.UTF-8`), but > the error persists. > > I'm really running out of ideas here, I run MediaWiki for years and while > it's a new jail to upgrade my env, this is not something I've seen before= . > > Note that I tried the same with PHP 8.2, same error. > > Any suggestions on how to resolve this would be greatly appreciated. > > thanks & regards > > Adrian > > > I have been running Mediawiki on FreeBSD for about ten years. I=E2=80=99v= e never > seen this issue. > > How did you install apache, php and Mediawiki? Which version of Mediawiki= ? > > Did you use pkg for all of them? If so, all needed parts of php should be > there and working. Have you done anything unusual to php.ini? > > I used to use apache and php from ports but have always installed Mediwik= i > from source. Hence, I=E2=80=99ve had to insure that all the needed php ex= tensions > are installed. > > I=E2=80=99ve since switched from apache to nginx, as there was an issue w= ith > apache that took a long time to resolve. > > Marius > -- > Marius Schamschula > > > > --00000000000086cee106235b9607 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Peace be upon you. I have a Garmin device and the OpenSeaMap= map (UTF-8) does not work. Please help.


=D9=81= =D9=8A =D8=A7=D9=84=D8=A7=D8=AB=D9=86=D9=8A=D9=86=D8=8C =D9=A3=D9=A0 =D8=B3= =D8=A8=D8=AA=D9=85=D8=A8=D8=B1 =D9=A2=D9=A0=D9=A2=D9=A4, =D9=A1=D9=A0:=D9= =A2=D9=A7 =D9=85 Marius Schamschula <lists@schamschula.com> =D9=83=D8=AA=D8=A8:
=
On Sep 30, 2024, at 1:39=E2=80=AFPM, Adrian = Gschwend <ml-ktk@netlabs.org> wrote:

Hi group,=

I'm trying to install MediaWiki on FreeBSD with Apache and PHP = 8.1 via mod_php, but I keep running into an issue related to the `Intl` ext= ension and locale settings. During the MediaWiki installation process, I ge= t the following error:

```
IntlException: Constructor failed
`= ``

There are no errors in the Apache log, and I have doublechecked t= hat the `Intl` extension is enabled and working in CLI PHP. When I run the = same code via Apache, it throws an exception.

I created a minimal PH= P test case to see if I could reproduce the error outside of MediaWiki. Her= e's the test script:

```
<?php

// Set the locale to= test
$locale =3D 'en_US.UTF-8';

// Check if Intl extensi= on is loaded
if (!extension_loaded('intl')) {
=C2=A0=C2=A0= =C2=A0die("Intl extension is not loaded!\n");
}

// Disp= lay the current locale settings
echo "Current locale: " . setl= ocale(LC_ALL, 0) . "\n";

// Test the Intl NumberFormatter<= br>try {
=C2=A0=C2=A0=C2=A0$formatter =3D new NumberFormatter($locale, = NumberFormatter::DECIMAL);
=C2=A0=C2=A0=C2=A0echo "Number formatti= ng test: " . $formatter->format(12345.67) . "\n";
} ca= tch (Exception $e) {
=C2=A0=C2=A0=C2=A0echo "IntlException: "= . $e->getMessage() . "\n";
}
?>

```

Re= sults:

- Command Line PHP:

=C2=A0```
=C2=A0Current local= e: C/C.UTF-8/C/C/C/C
=C2=A0Number formatting test: 12,345.67
=C2=A0= ```

- Apache (via browser):

=C2=A0```
=C2=A0Current loca= le: C/C.UTF-8/C/C/C/C
=C2=A0IntlException: Constructor failed
=C2= =A0```

So the same script works on the same jail on cli but not in A= pache with mod_php.

What I've Tried

- I have set `LANG` a= nd `LC_ALL` to `en_US.UTF-8` in both the Apache environment and PHP=E2=80= =99s `php.ini`.
- I verified that the `Intl` extension is loaded in both= CLI and Apache environments.
- `phpinfo()` reports the correct locale i= n Apache (`en_US.UTF-8`), but the error persists.

I'm really run= ning out of ideas here, I run MediaWiki for years and while it's a new = jail to upgrade my env, this is not something I've seen before.

= Note that I tried the same with PHP 8.2, same error.

Any suggestions= on how to resolve this would be greatly appreciated.

thanks & r= egards

Adrian


I= have been running Mediawiki on FreeBSD for about ten years. I=E2=80=99ve n= ever seen this issue.

How did you install apache, php and Mediawiki? Which version of Mediaw= iki?

Did you use pkg for all of them? If so, all needed parts of php s= hould be there and working. Have you done anything unusual to php.ini?

= I used to use apache and php from ports but have always installed Mediwiki = from source. Hence, I=E2=80=99ve had to insure that all the needed php exte= nsions are installed.

I=E2=80=99ve since switched from apache to nginx,= as there was an issue with apache that took a long time to resolve.
<= /div>
Marius
--
Mari= us Schamschula



--00000000000086cee106235b9607--