Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Sep 2024 22:55:23 +0300
From:      =?UTF-8?B?2KfYqNmIINio2YbYr9ixINin2YTYudi12YrZhdmK?= <gaberalasmy@gmail.com>
To:        Marius Schamschula <lists@schamschula.com>
Cc:        freebsd-questions@freebsd.org, Adrian Gschwend <ml-ktk@netlabs.org>
Subject:   Re: Issue with MediaWiki Installation: IntlException and Locale Problems in Apache
Message-ID:  <CAAiXr3EQW67iKj9t-oHH4r=1c3uEP7E=b8TC8WSZMq1bfapu9g@mail.gmail.com>
In-Reply-To: <E6E4D750-B4AD-4448-8A31-ADDD2D89353E@schamschula.com>
References:  <db002b72-0efa-4f4d-bb53-a28ddde77ad2@netlabs.org> <E6E4D750-B4AD-4448-8A31-ADDD2D89353E@schamschula.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--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 <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` 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:
>
> ```
> <?php
>
> // 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

<p dir=3D"ltr">Peace be upon you. I have a Garmin device and the OpenSeaMap=
 map (UTF-8) does not work. Please help.</p>
<br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">=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 &lt;<a href=3D"mailto:lists@schamschula=
.com">lists@schamschula.com</a>&gt; =D9=83=D8=AA=D8=A8:<br></div><blockquot=
e class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc sol=
id;padding-left:1ex"><div style=3D"line-break:after-white-space"><div><div>=
<blockquote type=3D"cite"><div>On Sep 30, 2024, at 1:39=E2=80=AFPM, Adrian =
Gschwend &lt;<a href=3D"mailto:ml-ktk@netlabs.org" target=3D"_blank" rel=3D=
"noreferrer">ml-ktk@netlabs.org</a>&gt; wrote:</div><br><div><div>Hi group,=
<br><br>I&#39;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:<br><br>```<br>IntlException: Constructor failed<br>`=
``<br><br>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.<br><br>I created a minimal PH=
P test case to see if I could reproduce the error outside of MediaWiki. Her=
e&#39;s the test script:<br><br>```<br>&lt;?php<br><br>// Set the locale to=
 test<br>$locale =3D &#39;en_US.UTF-8&#39;;<br><br>// Check if Intl extensi=
on is loaded<br>if (!extension_loaded(&#39;intl&#39;)) {<br> =C2=A0=C2=A0=
=C2=A0die(&quot;Intl extension is not loaded!\n&quot;);<br>}<br><br>// Disp=
lay the current locale settings<br>echo &quot;Current locale: &quot; . setl=
ocale(LC_ALL, 0) . &quot;\n&quot;;<br><br>// Test the Intl NumberFormatter<=
br>try {<br> =C2=A0=C2=A0=C2=A0$formatter =3D new NumberFormatter($locale, =
NumberFormatter::DECIMAL);<br> =C2=A0=C2=A0=C2=A0echo &quot;Number formatti=
ng test: &quot; . $formatter-&gt;format(12345.67) . &quot;\n&quot;;<br>} ca=
tch (Exception $e) {<br> =C2=A0=C2=A0=C2=A0echo &quot;IntlException: &quot;=
 . $e-&gt;getMessage() . &quot;\n&quot;;<br>}<br>?&gt;<br><br>```<br><br>Re=
sults:<br><br>- Command Line PHP:<br><br> =C2=A0```<br> =C2=A0Current local=
e: C/C.UTF-8/C/C/C/C<br> =C2=A0Number formatting test: 12,345.67<br> =C2=A0=
```<br><br>- Apache (via browser):<br><br> =C2=A0```<br> =C2=A0Current loca=
le: C/C.UTF-8/C/C/C/C<br> =C2=A0IntlException: Constructor failed<br> =C2=
=A0```<br><br>So the same script works on the same jail on cli but not in A=
pache with mod_php.<br><br>What I&#39;ve Tried<br><br>- 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`.<br>- I verified that the `Intl` extension is loaded in both=
 CLI and Apache environments.<br>- `phpinfo()` reports the correct locale i=
n Apache (`en_US.UTF-8`), but the error persists.<br><br>I&#39;m really run=
ning out of ideas here, I run MediaWiki for years and while it&#39;s a new =
jail to upgrade my env, this is not something I&#39;ve seen before.<br><br>=
Note that I tried the same with PHP 8.2, same error.<br><br>Any suggestions=
 on how to resolve this would be greatly appreciated.<br><br>thanks &amp; r=
egards<br><br>Adrian<br><br></div></div></blockquote></div><br></div><div>I=
 have been running Mediawiki on FreeBSD for about ten years. I=E2=80=99ve n=
ever seen this issue.</div><div><br></div><div><span style=3D"color:rgb(0,0=
,0)">How did you install apache, php and Mediawiki? Which version of Mediaw=
iki?</span><div style=3D"color:rgb(0,0,0)"><br></div><div style=3D"color:rg=
b(0,0,0)">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?</div=
><div style=3D"color:rgb(0,0,0)"><br></div><div style=3D"color:rgb(0,0,0)">=
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.</div><div style=3D"color:rgb(0,0,0)"><br></div><div s=
tyle=3D"color:rgb(0,0,0)">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><=
/div><br><div>
<div style=3D"color:rgb(0,0,0);font-family:Helvetica;font-size:12px;font-st=
yle:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:norma=
l;text-align:start;text-indent:0px;text-transform:none;white-space:normal;w=
ord-spacing:0px">Marius</div><div style=3D"color:rgb(0,0,0);font-family:Hel=
vetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weigh=
t:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transf=
orm:none;white-space:normal;word-spacing:0px">--</div><div style=3D"color:r=
gb(0,0,0);font-family:Helvetica;font-size:12px;font-style:normal;font-varia=
nt-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;te=
xt-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">Mari=
us Schamschula</div><div style=3D"color:rgb(0,0,0);font-family:Helvetica;fo=
nt-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;=
letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;=
white-space:normal;word-spacing:0px"><br></div><br>
</div>
<br></div></blockquote></div>

--00000000000086cee106235b9607--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAAiXr3EQW67iKj9t-oHH4r=1c3uEP7E=b8TC8WSZMq1bfapu9g>