Topic on Project:Support desk

Fatal error: Class 'MonoBookTemplate' not found in...

11
Medialifesf (talkcontribs)

Hi! I have moved my wiki site to a new hosting following these instructions: http://www.mediawiki.org/wiki/Manual:Moving_a_wiki But on the new hosting I got this error and I cannot access at all the website: Fatal error: Class 'MonoBookTemplate' not found in .../skins/Modern/Modern.php on line 51 Line 51 says: class ModernTemplate extends MonoBookTemplate { I haven't changed that file at all... Can you help me? Thanks!

88.130.84.126 (talkcontribs)

Which version of MediaWiki are you using? The file name makes me think it's 1.24. Right?

You say that you have moved the wiki - that means that you have not done an upgrade, right?

Anyway, you might want to empty all caches you find, especially those on the server!

Medialifesf (talkcontribs)

HI! Unfortunately I cannot access the website and I don't know which version is it. But I make updates every time my CPanel informs me there is an upgrade. So I think it must be last version. But you are right, I haven't made upgrade just before moving. How can I empty the cache on the server? Thanks!

Medialifesf (talkcontribs)

Hi! My hosting company answered to me that the server has no cache. What solution can you give me to recover my site? Thanks!

Ciencia Al Poder (talkcontribs)

Try paying the bill

92.247.200.57 (talkcontribs)

I meant cache... not cash... but really... if someone can help me recover my website, I would appreciate it, it's not time for jokes for me...

88.130.84.126 (talkcontribs)

When you say that you followed Manual:Moving_a_wiki, how have you installed the files of your MeiaWiki version? Have you taken them from a tar archive, which you had created before? Or did you download a new version from mediawiki.org and used that one?

Having a look at the 1.24 version of the Modern skin, the class ModernTemplate is defined in SkinModern.php, not in Modern.php.

Are you maybe still using old skin files, which cause trouble? See Manual:Upgrading#Files_remaining_that_may_cause_errors!

Please make sure that

  • a) the right files were extracted on the new server and
  • b) all files were extracted.
Medialifesf (talkcontribs)

Hi! I returned the website to the old hosting so I can try to move it again to the new hosting. My wiki version is: MediaWiki 1.24.1; PHP 5.3.27 (cgi-fcgi); MySQL 5.5.40-cll So do I have to upgrade it before moving? So that's what I did: 1. Back up the database and files 2. Create new database and user in the new hosting and import the database via phpMyAdmin 3. Import all the website files via ftp 4. Update the LocalSettings.php file with new database, user and password

So I didn't download and put a new version of Mediawiki, I transfered all its files via ftp from the old hosting to the new one. Am I missing something?

88.130.114.251 (talkcontribs)

Ok, that means that you are not by accident using wrong files, but that you have the same files as you had before.

The class ModernTemplate is defined in SkinModern.php, not in Modern.php. Is it correct that you get the error for SkinModern.php and not for Modern.php?

Finally: On the new server, after you extracted your archive, do you then have a file skins/Monobook/MonoBookTemplate.php, which contains the class MonoBookTemplate?

Medialifesf (talkcontribs)

Hi! The error was Fatal error: Class 'MonoBookTemplate' not found in .../skins/Modern/Modern.php on line 51 Line 51 says: class ModernTemplate extends MonoBookTemplate I haven't changed any files and on the old hosting everything is Ok and on the new hosting I got that error. The strange thing I noticed now in the old hosting is that every skin has 2 folders in skins - Modern and modern, Monobook and monobook. In both Modern and modern folder there is file called Modern.php but they have different content. In Modern folder Modern.php has no line 51. In modern folder Modern.php has line 51 which says: class ModernTemplate extends MonoBookTemplate { Is this proper or not?

88.130.114.251 (talkcontribs)

Alright, the folders with their names all in lowercase come from older versions of MediaWiki. These folders should have been removed during the upgrade to 1.24. You should remove them. Also, if you still have files (e.g. called Vector.php, Modern.php and so on) directly in the skins/ folder, meaning outside of the according Vector/ and MonoBook/ folders, remove these files as well.

Make sure that you have a require_once line for the Modern skin in your LocalSettings.php file like so:

 require_once "$IP/skins/Modern/Modern.php";

Add according lines for all skins, which your visitors should be able to choose from (or which they might be using already). Without such a line, a user, who is using the according skin, will get a fatal error.

If that does not solve the problem, then it will at least improve the situation.

Reply to "Fatal error: Class 'MonoBookTemplate' not found in..."