[Mediawiki-l] Upgrade to 1.18

Daniel Friesen lists at nadir-seen-fire.com
Tue Nov 29 17:31:19 UTC 2011

On Tue, 29 Nov 2011 08:58:09 -0800, Gordon Joly <gordon.joly at pobox.com>  

> I have Mediawiki installation went from 1.17 through 1.18 RC1 and to
> 1.18 - no problems.
> But another Mediawiki has had some problems going direct from 1.17 to
> 1.18 - I took out Recaptcha and now see this:
> *Fatal error*: Cannot redeclare wfprofilein() (previously declared in
> /xxxxxxxx/public_html/includes/profiler/Profiler.php:14) in
> */xxxxx/public_html/includes/ProfilerStub.php* on line *25*
> Not sure why...
> Gordo

Sounds like you upgraded MediaWiki by extracting 1.18 on top of 1.17  
instead of extracting 1.18 to a new directory then moving the config and  
other stuff to the new directory. And have an old StartProfiler.php.

includes/ProfilerStub.php was moved to includes/profiler/Profiler.php and  
includes/profiler/ProfilerStub.php in 1.18

Basically what it looks like is happening is that you have a  
includes/ProfilerStub.php file from 1.17 and includes/profiler/ from 1.18.
Because your StartProfiler.php likely uses the old method of a  
require_once (instead of autoloading as I believe we now do) MediaWiki is  
loading the 1.18 profiler code from includes/profiler/Profiler.php and  
then when it require your StartProfiler.php that old require_once is  
requiring the old 1.17 code from includes/ProfilerStub.php causing a fatal  
error as the old code tries to redefine the same method.

If you don't need the profiler I recommend you delete your  
StartProfiler.php. If you do you should probably delete the require_once  
You'd also probably be better off clearing out all the outdated files of  
1.17 code that were left behind since you extracted 1.18 over top of 1.17.  
Though the easiest way to do that is to just re-untar 1.18 in another  
directory, and move your actual LocalSettings, extensions, images/, etc...  
to there.

~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name]

More information about the MediaWiki-l mailing list