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
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 mi.lists@alma.ch је написао/ла:
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 -- mediawiki-l@lists.wikimedia.org To unsubscribe send an email to mediawiki-l-leave@lists.wikimedia.org
https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.org/
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 mi.lists@alma.ch је написао/ла:
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 -- mediawiki-l@lists.wikimedia.org To unsubscribe send an email to mediawiki-l-leave@lists.wikimedia.org https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.org/
MediaWiki-l mailing list --mediawiki-l@lists.wikimedia.org To unsubscribe send an email tomediawiki-l-leave@lists.wikimedia.org https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.org/
According to https://www.mediawiki.org/wiki/Manual:LocalSettings.php , "The $IP (install path) variable holds the local file path to the base installation of your wiki. Since MediaWiki 1.18, the system sets $IP automatically. Setting $IP manually in LocalSettings.php is no longer needed. $IP will default to the current working directory and can be used without the need to manually define it. Attempting to set $IP (or MW_INSTALL_PATH) in LocalSettings.php may produce unexpected results.”
Maybe it would work simply to remove the line with MW_INSTALL_PATH from LocalSettings.php.
Good luck!
Tom
On Nov 11, 2025, at 7:22 AM, MI mi.lists@alma.ch wrote:
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 <mi.lists@alma.ch mailto:mi.lists@alma.ch> је написао/ла:
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 -- mediawiki-l@lists.wikimedia.org mailto:mediawiki-l@lists.wikimedia.org To unsubscribe send an email to mediawiki-l-leave@lists.wikimedia.org mailto:mediawiki-l-leave@lists.wikimedia.org https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.org/
MediaWiki-l mailing list -- mediawiki-l@lists.wikimedia.org mailto:mediawiki-l@lists.wikimedia.org To unsubscribe send an email to mediawiki-l-leave@lists.wikimedia.org mailto:mediawiki-l-leave@lists.wikimedia.org https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.org/
MediaWiki-l mailing list -- mediawiki-l@lists.wikimedia.org To unsubscribe send an email to mediawiki-l-leave@lists.wikimedia.org https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.org/
Wenlin Institute, Inc. SPC (a Social Purpose Corporation) 文林研究所社会目的公司 Software for Learning Chinese E-mail: wenlin@wenlin.com Web: https://wenlin.com https://wenlin.com/ Telephone: 1-877-4-WENLIN (1-877-493-6546) ☯Unity in Diversity☮
Hello!
FWIW: In my setup I have to defined the install path as well. I do this by providing each Wiki instance with a snippet of Apache configuration:
Alias /wiki1 /data/mediawiki/instances/wiki1 <Directory /data/mediawiki/instances/wiki1> SetEnv MW_INSTALL_PATH /data/mediawiki/instances/wiki1 </Directory>
The directory /data/mediawiki/instances/wiki1 contains mostly symlinks to a common installation directory of the MediaWiki release. Only LocalSettings.php is not a symlink. Without the definition of MW_INSTALL_PATH, "wiki1" would search for LocalSettings.php in the wrong directory. So in my case setting MW_INSTALL_PATH is a necessity.
Joern
Am 11.11.2025 um 18:05 schrieb Thomas Eugene Bishop:
According to https://www.mediawiki.org/wiki/Manual:LocalSettings.php https://www.mediawiki.org/wiki/Manual:LocalSettings.php , "The $IP (install path) variable holds the local file path to the base installation of your wiki. Since MediaWiki 1.18, the system sets $IP automatically. Setting $IP manually in LocalSettings.php is no longer needed. $IP will default to the current working directory and can be used without the need to manually define it. Attempting to set $IP (or MW_INSTALL_PATH) in LocalSettings.php may produce unexpected results.”
Maybe it would work simply to remove the line with MW_INSTALL_PATH from LocalSettings.php.
Good luck!
Tom
On Nov 11, 2025, at 7:22 AM, MI mi.lists@alma.ch wrote:
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 mi.lists@alma.ch је написао/ла:
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 -- mediawiki-l@lists.wikimedia.org To unsubscribe send an email to mediawiki-l-leave@lists.wikimedia.org https://lists.wikimedia.org/postorius/lists/mediawiki- l.lists.wikimedia.org/
MediaWiki-l mailing list --mediawiki-l@lists.wikimedia.org To unsubscribe send an email tomediawiki-l-leave@lists.wikimedia.org https://lists.wikimedia.org/postorius/lists/mediawiki- l.lists.wikimedia.org/
MediaWiki-l mailing list -- mediawiki-l@lists.wikimedia.org To unsubscribe send an email to mediawiki-l-leave@lists.wikimedia.org https://lists.wikimedia.org/postorius/lists/mediawiki- l.lists.wikimedia.org/
Wenlin Institute, Inc. SPC (a Social Purpose Corporation) 文林研究所社会目的公司 Software for Learning Chinese E-mail: wenlin@wenlin.com Web: https://wenlin.com https://wenlin.com Telephone: 1-877-4-WENLIN (1-877-493-6546) ☯Unity in Diversity☮
MediaWiki-l mailing list -- mediawiki-l@lists.wikimedia.org To unsubscribe send an email to mediawiki-l-leave@lists.wikimedia.org https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.org/
quick followup, as the OP asked about a command line operation: These work fine for me, despite the symlinks. I do regular upgrades and have used some of the maintenance scripts in the past. The variable is only in effect when Apache accesses the Wiki.
Am 12.11.2025 um 08:52 schrieb Clausen, Jörn:
Hello!
FWIW: In my setup I have to defined the install path as well. I do this by providing each Wiki instance with a snippet of Apache configuration:
Alias /wiki1 /data/mediawiki/instances/wiki1 <Directory /data/mediawiki/instances/wiki1> SetEnv MW_INSTALL_PATH /data/mediawiki/instances/wiki1
</Directory>
The directory /data/mediawiki/instances/wiki1 contains mostly symlinks to a common installation directory of the MediaWiki release. Only LocalSettings.php is not a symlink. Without the definition of MW_INSTALL_PATH, "wiki1" would search for LocalSettings.php in the wrong directory. So in my case setting MW_INSTALL_PATH is a necessity.
Joern
Am 11.11.2025 um 18:05 schrieb Thomas Eugene Bishop:
According to https://www.mediawiki.org/wiki/Manual:LocalSettings.php https://www.mediawiki.org/wiki/Manual:LocalSettings.php , "The $IP (install path) variable holds the local file path to the base installation of your wiki. Since MediaWiki 1.18, the system sets $IP automatically. Setting $IP manually in LocalSettings.php is no longer needed. $IP will default to the current working directory and can be used without the need to manually define it. Attempting to set $IP (or MW_INSTALL_PATH) in LocalSettings.php may produce unexpected results.”
Maybe it would work simply to remove the line with MW_INSTALL_PATH from LocalSettings.php.
Good luck!
Tom
On Nov 11, 2025, at 7:22 AM, MI mi.lists@alma.ch wrote:
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 mi.lists@alma.ch је написао/ла:
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 -- mediawiki-l@lists.wikimedia.org To unsubscribe send an email to mediawiki-l- leave@lists.wikimedia.org https://lists.wikimedia.org/postorius/lists/mediawiki- l.lists.wikimedia.org/
MediaWiki-l mailing list --mediawiki-l@lists.wikimedia.org To unsubscribe send an email tomediawiki-l-leave@lists.wikimedia.org https://lists.wikimedia.org/postorius/lists/mediawiki- l.lists.wikimedia.org/
MediaWiki-l mailing list -- mediawiki-l@lists.wikimedia.org To unsubscribe send an email to mediawiki-l-leave@lists.wikimedia.org https://lists.wikimedia.org/postorius/lists/mediawiki- l.lists.wikimedia.org/
Wenlin Institute, Inc. SPC (a Social Purpose Corporation) 文林研究所社会目的公司 Software for Learning Chinese E-mail: wenlin@wenlin.com Web: https://wenlin.com <https:// wenlin.com> Telephone: 1-877-4-WENLIN (1-877-493-6546) ☯Unity in Diversity☮
MediaWiki-l mailing list -- mediawiki-l@lists.wikimedia.org To unsubscribe send an email to mediawiki-l-leave@lists.wikimedia.org https://lists.wikimedia.org/postorius/lists/mediawiki- l.lists.wikimedia.org/
Indeed, the wiki actually works fine after simply removing the |define('MW_INSTALL_PATH'| line. And the |purgeList.php| command doesn't complain anymore.
Thank you!
MI
-------- Original Message -------- (Thomas Eugene Bishop, 11/11/2025 18.05)
According to https://www.mediawiki.org/wiki/Manual:LocalSettings.php%C2%A0, "The $IP (install path) variable holds the local file path to the base installation of your wiki. Since MediaWiki 1.18, the system sets $IP automatically. Setting $IP manually in LocalSettings.php is no longer needed. $IP will default to the current working directory and can be used without the need to manually define it. Attempting to set $IP (or MW_INSTALL_PATH) in LocalSettings.php may produce unexpected results.”
Maybe it would work simply to remove the line with MW_INSTALL_PATH from LocalSettings.php.
Good luck!
Tom
On Nov 11, 2025, at 7:22 AM, MI mi.lists@alma.ch wrote:
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 mi.lists@alma.ch је написао/ла:
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 -- mediawiki-l@lists.wikimedia.org To unsubscribe send an email to mediawiki-l-leave@lists.wikimedia.org https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.org/
MediaWiki-l mailing list --mediawiki-l@lists.wikimedia.org To unsubscribe send an email tomediawiki-l-leave@lists.wikimedia.org https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.org/
MediaWiki-l mailing list -- mediawiki-l@lists.wikimedia.org To unsubscribe send an email to mediawiki-l-leave@lists.wikimedia.org https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.org/
Wenlin Institute, Inc. SPC (a Social Purpose Corporation) 文林研究所社会目的公司 Software for Learning Chinese E-mail: wenlin@wenlin.com Web: https://wenlin.com Telephone: 1-877-4-WENLIN (1-877-493-6546) ☯Unity in Diversity☮
MediaWiki-l mailing list --mediawiki-l@lists.wikimedia.org To unsubscribe send an email tomediawiki-l-leave@lists.wikimedia.org https://lists.wikimedia.org/postorius/lists/mediawiki-l.lists.wikimedia.org/
mediawiki-l@lists.wikimedia.org