Re: PHP Warning: Constant MW_INSTALL_PATH already defined

MI <[email protected]> Tue, 11 Nov 2025 13:22:46 +0100
Newsgroups gmane.org.wikimedia.mediawiki
Message-ID <[email protected]>
This is a multi-part message in MIME format.
--===============0328420197733329106==
Content-Type: multipart/alternative;
 boundary="------------LR0WieauYk1vQiF78JS5oIPl"
Content-Language: en-US, fr

This is a multi-part message in MIME format.
--------------LR0WieauYk1vQiF78JS5oIPl
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

Thanks. I had checked that, and it's not defined twice.


-------- Original Message -------- (Zoran Dori, 11/11/2025 12.32)
> Hello,
> I suggest checking if `MW_INSTALL_PATH` is defined twice in your 
> `LocalSettings.php`. This could be causing the warning you’re seeing.
>
> Best regards,
> Zoran
>
> уто, 11. нов 2025. у 12:18 MI <[email protected]> је написао/ла:
>
>     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.org/
>
>
> _______________________________________________
> MediaWiki-l mailing list [email protected]
> To unsubscribe send an email [email protected]
> https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.org/
--------------LR0WieauYk1vQiF78JS5oIPl
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit

<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Thanks. I had checked that, and it's not defined twice.</p>
    <p><br>
    </p>
    <div class="moz-cite-prefix">-------- Original Message --------
      (Zoran Dori, 11/11/2025 12.32)<br>
    </div>
    <blockquote type="cite"
cite="mid:CAOKmWLHmMCS=tjRVgRTWKUzhfHLX2Smh5w4eWJR3crJgz2ufPg@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">Hello,<br>
        I suggest checking if `MW_INSTALL_PATH` is defined twice in your
        `LocalSettings.php`. This could be causing the warning you’re
        seeing.
        <div><br>
        </div>
        <div>Best regards,<br>
          Zoran</div>
      </div>
      <br>
      <div class="gmail_quote gmail_quote_container">
        <div dir="ltr" class="gmail_attr">уто, 11. нов 2025. у 12:18 MI
          &lt;<a href="mailto:[email protected]" moz-do-not-send="true"
            class="moz-txt-link-freetext">[email protected]</a>&gt; је
          написао/ла:<br>
        </div>
        <blockquote class="gmail_quote"
style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
          <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/maintenance/purgeList.php</pre>
            </blockquote>
            <p>The full error is<br>
            </p>
            <blockquote>
              <pre>PHP Warning:  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 explicitly.
# 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". 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="mailto:[email protected]"
            target="_blank" moz-do-not-send="true"
            class="moz-txt-link-freetext">[email protected]</a><br>
          To unsubscribe send an email to <a
            href="mailto:[email protected]"
            target="_blank" moz-do-not-send="true"
            class="moz-txt-link-freetext">[email protected]</a><br>
          <a
href="https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.org/"
            rel="noreferrer" target="_blank" moz-do-not-send="true"
            class="moz-txt-link-freetext">https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.org/</a></blockquote>
      </div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
MediaWiki-l mailing list -- <a class="moz-txt-link-abbreviated" href="mailto:[email protected]">[email protected]</a>
To unsubscribe send an email to <a class="moz-txt-link-abbreviated" href="mailto:[email protected]">[email protected]</a>
<a class="moz-txt-link-freetext" href="https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.org/">https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.org/</a></pre>
    </blockquote>
  </body>
</html>

--------------LR0WieauYk1vQiF78JS5oIPl--

--===============0328420197733329106==
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/
--===============0328420197733329106==--