Pat Furrie's picture

I've been reading the instructions on the MediaWiki website for upgrading 1.15 to 1.16.  After doing what I thought was being said, I got the following error when I tried to test the wiki:

Fatal error: Call to undefined method MediaWiki::initialize() in /usr/share/mediawiki/index.php on line 116

Hmmm.  The part which surprised me was the path it gives: "/usr/share/mediawiki/".  During the upgrade procedure, the instructions said to uncompress the tarball, and the sample command line said: "/path/to/your/wiki/".  I changed out that verbage, and put down what I *thought* was the path to my wiki: "/var/lib/mediawiki/".  Certainly, if I go to "/var/lib/mediawiki/", there are all the MediaWiki files, and I've always thought that was where the action was taking place.  Now I'm surprised to find another bunch of MediaWiki files (looking similar to the first) in "/usr/share/mediawiki/".

Question: Which one is the correct "path to my wiki"?

Next question: Why are there two similar MediaWiki folders?



Adrian Moya's picture

I haven't check the mediawiki appliance, but as you say you uncompress a tar in /var/lib/mediawiki, maybe those are the files you are seeing, and the ones on /usr/share/mediawiki are the ones of the appliance. Check the date of the files with ls -l command to be sure (or install a fresh mediawiki on a VM and check the patch).

Hope it helps

Pat Furrie's picture


Well, the /var/lib/mediawiki files were definitely there before.  But I had to double-check, so before I posted the question, I had re-downloaded the Turnkey MediaWiki VM and looked:  both those directories exist.

The question still is: why?


Adrian Moya's picture

Probably is the way that ubuntu organized the files following the FSH standard. If so, the files in /var/lib/mediawiki should be files used by the system (it's backend) and files in /usr/share/mediawiki must be the contents itself. Sorry I don't know much about mediawiki, I think you should google a bit about upgrading mediawiki specifically in ubuntu. Check the files installed by the package with

dpkg -L mediawiki 

And you'll see the content of the ubuntu mediawiki package. If there are docs in there, try to check them for a correct upgrade path. 

Jeremy Davis's picture

And I can confirm that in my install there are no files in /var/lib/mediawiki (no important files anyway, but the dir does exist), all the MediaWiki files are found in /usr/share/mediawiki. Although mine is an older version of TKL Mediawiki (v2009.04, uses MediaWiki v1.14 - current is 2009.10-2). From the TKL MediaWiki changelog I can see that MediaWiki was upgraded (to v1.15) but it is not 100% clear whether that also meant a change of where it was installed to (but I would doubt it).

So I would assume that the place to upload your new files to (to upgrade MediaWiki) would be /usr/share/mediawiki. I would assume that both the locations exist as they are created by the debian package which installs MediaWiki (in other words you'd probably need to ask the Debian packager of MediaWiki). Although I may be wrong.

Add new comment