Re: PHP Warning: Constant MW_INSTALL_PATH already defined
Zoran Dori <[email protected]> Tue, 11 Nov 2025 12:32:39 +0100
| Newsgroups | gmane.org.wikimedia.mediawiki |
|---|---|
| Message-ID | <CAOKmWLHmMCS=tjRVgRTWKUzhfHLX2Smh5w4eWJR3crJgz2ufPg@mail.gmail.com> |
--===============6885019785644650430==
Content-Type: multipart/alternative; boundary="0000000000001158b106435002d8"
--0000000000001158b106435002d8
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Hello,
I suggest checking if `MW_INSTALL_PATH` is defined twice in your
`LocalSettings.php`. This could be causing the warning you=E2=80=99re seein=
g.
Best regards,
Zoran
=D1=83=D1=82=D0=BE, 11. =D0=BD=D0=BE=D0=B2 2025. =D1=83 12:18 MI <mi.lists@=
alma.ch> =D1=98=D0=B5 =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BE/=D0=BB=D0=
=B0:
> Since I upgraded mediawiki from v. 1.35 to v. 1.39, I get this error when
> running a script to purge the cache.
>
> The command producing the error is
>
> echo "Main_Page" | php /usr/share/mediawiki/maintenance/purgeList.php
>
> The full error is
>
> PHP Warning: Constant MW_INSTALL_PATH already defined in /etc/mediawiki/=
LocalSettings.php on line 25
>
> Indeed I have this on lines 21 to 25 in LocalSettings.php:
>
> # We define this to allow the configuration file to be explicitly.
> # located in /etc/mediawiki.
> # Change this if you are setting up multisite wikis on your server.
> define('MW_INSTALL_PATH','/docs/www-wiki');
>
> I had this through many MW versions over the years, and I don't think I
> can remove it.
>
> How can I get rid of this error? (The purge script runs every night from
> crontab, so I get a mail every day with this "error". And of course I don=
't
> want to just suppress any errors by redirecting stderr)
>
> Thanks,
>
> MI
>
> _______________________________________________
> MediaWiki-l mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
>
> https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.o=
rg/
--0000000000001158b106435002d8
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Hello,<br>I suggest checking if `MW_INSTALL_PATH` is defin=
ed twice in your `LocalSettings.php`. This could be causing the warning you=
=E2=80=99re seeing.<div><br></div><div>Best regards,<br>Zoran</div></div><b=
r><div class=3D"gmail_quote gmail_quote_container"><div dir=3D"ltr" class=
=3D"gmail_attr">=D1=83=D1=82=D0=BE, 11. =D0=BD=D0=BE=D0=B2 2025. =D1=83 12:=
18 MI <<a href=3D"mailto:[email protected]">[email protected]</a>> =D1=
=98=D0=B5 =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BE/=D0=BB=D0=B0:<br></div=
><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border=
-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>
=20
=20
=20
<div>
<p>Since I upgraded mediawiki from v. 1.35 to v. 1.39, I get this
error when running a script to purge the cache.</p>
<p>The command producing the error is</p>
<blockquote>
<pre>echo "Main_Page" | php /usr/share/mediawiki/maintenanc=
e/purgeList.php</pre>
</blockquote>
<p>The full error is<br>
</p>
<blockquote>
<pre>PHP Warning:=C2=A0 Constant MW_INSTALL_PATH already defined in /=
etc/mediawiki/LocalSettings.php on line 25
</pre>
</blockquote>
<p>Indeed I have this on lines 21 to 25 in LocalSettings.php:</p>
<blockquote>
<pre># We define this to allow the configuration file to be explicitl=
y.
# located in /etc/mediawiki.
# Change this if you are setting up multisite wikis on your server.
define('MW_INSTALL_PATH','/docs/www-wiki');
</pre>
</blockquote>
<p>I had this through many MW versions over the years, and I don't
think I can remove it.</p>
<p>How can I get rid of this error? (The purge script runs every
night from crontab, so I get a mail every day with this "error&q=
uot;.
And of course I don't want to just suppress any errors by
redirecting stderr)</p>
<p>Thanks,</p>
<p>MI<br>
</p>
<br>
</div>
_______________________________________________<br>
MediaWiki-l mailing list -- <a href=3D"mailto:[email protected]=
rg" target=3D"_blank">[email protected]</a><br>
To unsubscribe send an email to <a href=3D"mailto:[email protected]=
ikimedia.org" target=3D"_blank">[email protected]</a><b=
r>
<a href=3D"https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wi=
kimedia.org/" rel=3D"noreferrer" target=3D"_blank">https://lists.wikimedia.=
org/postorius/lists/mediawiki-l.lists.wikimedia.org/</a></blockquote></div>
--0000000000001158b106435002d8--
--===============6885019785644650430==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
MediaWiki-l mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.org/
--===============6885019785644650430==--