Last modified: 2012-08-16 16:42:53 UTC
Math.php generates a large number of errors in my /var/log/apache2/error.log file. For examples: [Mon Aug 13 05:37:19 2012] [error] [client 12.34.56.78] PHP Notice: Constant MW_MATH_SIMPLE already defined in /var/lib/mediawiki/extensions/Math/Math.php on line 33, referer: http://server.com/url/whatever.html [Mon Aug 13 05:37:19 2012] [error] [client 12.34.56.78] PHP Notice: Constant MW_MATH_HTML already defined in /var/lib/mediawiki/extensions/Math/Math.php on line 34, referer: http://server.com/url/whatever.html [Mon Aug 13 05:37:19 2012] [error] [client 12.34.56.78] PHP Notice: Constant MW_MATH_SOURCE already defined in /var/lib/mediawiki/extensions/Math/Math.php on line 35, referer: http://server.com/url/whatever.html [Mon Aug 13 05:37:19 2012] [error] [client 12.34.56.78] PHP Notice: Constant MW_MATH_MODERN already defined in /var/lib/mediawiki/extensions/Math/Math.php on line 36, referer: http://server.com/url/whatever.html [Mon Aug 13 05:37:19 2012] [error] [client 12.34.56.78] PHP Notice: Constant MW_MATH_MATHML already defined in /var/lib/mediawiki/extensions/Math/Math.php on line 37, referer: http://server.com/url/whatever.html I'm far from a PHP expert, but I've modified Math.php to check if those constants are defined before defining them: if(!defined('MW_MATH_PNG')) { define( 'MW_MATH_PNG', 0 ); } if(!defined('MW_MATH_SIMPLE')) { define( 'MW_MATH_SIMPLE', 1 ); } if(!defined('MW_MATH_HTML')) { define( 'MW_MATH_HTML', 2 ); } if(!defined('MW_MATH_SOURCE')) { define( 'MW_MATH_SOURCE', 3 ); } if(!defined('MW_MATH_MODERN')) { define( 'MW_MATH_MODERN', 4 ); } if(!defined('MW_MATH_MATHML')) { define( 'MW_MATH_MATHML', 5 ); } The above change suppresses the errors in my apache error.log and my wiki pages still display math correctly. Can someone review and include this change in the git repo if appropriate? Math plugin: version 1.0 Media wiki: 1:1.15.1-1ubuntu2.1 (mediawiki)
Math wasn't removed from core till 1.18, so of course these errors are going to occur when you have "math" in core, and a newer Math extension. They're not designed to be used on the same wiki at the same time. Please note you are running a version of MediaWiki with known security issues, as well as it not being supported for further security updates and bugfixes [1] [1] https://www.mediawiki.org/wiki/Version_lifecycle