# Project:Support desk

vde   Welcome to MediaWiki.org's Support desk, where you can ask MediaWiki questions!

## Post a new question

• MediaWiki
• PHP
• Database
2. Please include the URL of your wiki unless you absolutely can't. It's often a lot easier for us to identify the source of the problem if we can look for ourselves.
3. To start a new thread, click "Start a new topic".

## Error 500 when a new, non-default skin is added to Localsettings.php

34

I got an error 500 after adding new skins to my LocalSettings.php. This has only occurred with additional skins that are NOT one of four default skins (Cologne Blue, Modern, MonoBook, Vector), and I appeared to have used the correct skin addition method for my current MediaWiki version. I made this wiki with Webhostface, and it runs on a currently supported version. However, I had no problems with adding user rights or enabling extensions.

I have not found a solution to fix this error, and I need some help fixing the error 500 on my wiki. Is there any way to fix this strange error and enable the skins without getting any more errors? Thank you.

• Which skin did you try to add?
• Which version of MediaWiki are you using?
• How exactly does the line look like, which you added to LocalSettings.php?

-I was adding two skins, one of them being Monaco and another (being a skin I created) called Candy.

-I am using MediaWiki 1.30

-The line looks exactly like this (Candy is the skin that I added):

# Enabled skins.

# The following skins were automatically enabled:

A 500 error message is not helpful at all. You'll need to look at server error logs to see a meaningful error message. See blank page

This post was hidden by 177.249.219.18 (history)

By the way, I could not find enough information on the error 500.

On which skin did you base the Candy skin? Is it basically a copy of the Vector skin, which you then modified? Or is it based on the Monaco skin?

> I could not find enough information on the error 500.

That is why Ciencia is asking for more information. This information should be in the error log of the webserver.

After looking at the Monaco skin,

https://github.com/dantman/monaco-port

this skin does not support the line with wfLoadSkin(), because it is still using the old skin architecture. The Monaco skin has to be included using a line with require_once "$IP/skins/monaco/monaco.php";. Does the error happen for both skins, Candy and Monaco? Apart from that, the last changes to the Monaco skin have been done four years ago. Maybe the skin is no longer working with current versions of MediaWiki. Candy is a copy of the MonoBook skin. And yes, the error happens for both Candy and Monaco. More information about your server error will be in the error log of the server. Without more information, we will not be able to help you. Okay. How do I debug the error then? I also get an error 500 when attempting to debug and log the errors. The error log of the webserver should contain the information about the error. How do you open the error log then? It wouldn't show up on my wiki. What do I need to type in to debug the error? ^^Look at the post above You already have the tools to debug the error. Nobody can tell you what do you need to type in to debug the error, because there are so many environments, operating systems, configurations, etc that is impossible to tell you the exact commands to type. If you don't plan to take a bit of time to locate the error logs by yourself, interpret them to at least post here the relevant information, feel free to spend some money by hiring someone from Professional development and consulting. The error looks like this: PHP Fatal error: Uncaught exception 'Exception' with message '/home/gjlxrtap/public_html/mw19/skins/Candy/skin.json does not exist!' in /home/gjlxrtap/public_html/mw19/includes/registration/ExtensionRegistry.php:99 Stack trace: #0 /home/gjlxrtap/public_html/mw19/includes/GlobalFunctions.php(157): ExtensionRegistry->queue('/home/gjlxrtap/...') #1 /home/gjlxrtap/public_html/mw19/LocalSettings.php(126): wfLoadSkin('Candy') #2 /home/gjlxrtap/public_html/mw19/includes/WebStart.php(102): require_once('/home/gjlxrtap/...') #3 /home/gjlxrtap/public_html/mw19/index.php(40): require('/home/gjlxrtap/...') #4 {main} thrown in /home/gjlxrtap/public_html/mw19/includes/registration/ExtensionRegistry.php on line 99 Look, a useful error message after all :) Looks like Candy skin doesn't support extension registration. You should use require_once "$IP/skins/Candy/Candy.php"; or similar instead of wfLoadSkin

I get the same error, even with the require_once setup. Even if the message is useful, is there a way that I could fix this?

Now I've got this error:

PHP Fatal error:  Class 'MonoBookTemplate' not found in /home/gjlxrtap/public_html/mw19/skins/Modern/SkinModern.php on line 51

I'm pretty sure my Modern skin version corresponds with the core version because the skin was built into the installation. Even if these messages are useful, I still need a way to get around this error and make my site run better.

This post was hidden by Newman2 (history)
This post was hidden by 2001:16B8:10A1:2100:3C43:EE16:CDE1:BE37 (history)

You are using MediaWiki 1.30, which is fine.

The skins, which are coming with MediaWiki 1.30, are Cologne Blue, Modern, MonoBook and Vector. These four skins all do have a skin.json file. Also the Modern skin should be working without the error "Class 'MonoBookTemplate' not found".

I think that something is wrong with the content of the four folders of these skins in the skins/ folder. I would delete these four folders and extract them again from the MediaWiki 1.30 tarball.

If the Candy skin is based on MonoBook from MediaWiki 1.30, it should be working.

Thanks for the info. But what software that is easy to download can debug any error including these ones?

You must enable error reporting - and obviously you have done that already as you already know the error message.

You should now replace the folders as detailed in my last post!

How do I extract those folders and enable error reporting? The fatal error occurs when I use the Modern skin, and the error 500 occurs when I add Candy to the site.

Now that I have enabled error reporting, now what do I do to debug this error? If the error reports and debugs are enabled, then how do I view and debug the errors if the error still occurs on my page? Where are the error displays located? I need some assistance on viewing the error reports.

Yes, I saw the page on debugging. The problem is that I do not know whether or not HHVM has debugging on my wiki's database. Also, I do not know where MediaWiki Vagrant would be located. If they are on there, then would they be in the maintenance folder, the includes folder, or what location in MediaWiki? Thank you for reading this.

I added the debug log file to my Localsettings.php, and it caused a 404 error. Does something else need to be send up, or does the $wgDBname have to be changed to the name of the database? There is something that needs to be done. The value of$wgDebugLogFile is the path you want to save. Name the file as you like, do not necessarily name the file by the example code.

> I added the debug log file to my Localsettings.php, and it caused a 404 error.

Very strange, it is likely that you misconfigured.

Reply to "Error 500 when a new, non-default skin is added to Localsettings.php"

## Help with math rendering

7

I have a wiki page where the maths rendered perfectly until recently. Now, without any change on my part (either to the wiki text or to LocalSettings.php), it does not.

http://wiki.glennersterlab.com/index.php/Main_Page

For example:

http://wiki.glennersterlab.com/index.php/Notation

now has unrendered text (as I originally inputted it), like:

$$$$\vec{r} = \begin{bmatrix} r_{1} \\ r_{2} \\ \vdots \\ r_{n} \end{bmatrix}$$$$

and I have put a png on the page to show how this used to render.

https://www.mathjax.org/#demo renders the text fine.

Can you tell me what needs to be done to get this to render properly? I have asked my web hosting provider but they have not been able to solve the problem.

MediaWiki 1.25.2

PHP 5.6.33 (litespeed)

The problem occurs on Chrome and Safari on a Mac and on an iPhone. I assume it applies to all browsers.

I am not a programmer, but relevant-looking lines in LocalSettings.php include the following (and there have been no changes in LocalSettings.php since it was working fine):

require_once "$IP/extensions/Math/Math.php";$wgUseTeX = true;

$wgMathPath = "{$wgUploadPath}/math";

$wgMathDirectory = "{$wgUploadDirectory}/math";

$wgTmpDirectory = "{$wgUploadDirectory}/tmp";

require_once "$IP/extensions/MathJax/MathJax.php";$wgParserCacheType = CACHE_NONE;

require_once "$IP/extensions/SimpleMathJax/SimpleMathJax.php";$wgSimpleMathJaxSize = 120;

In addition to updated, I'd also mention, You also seem to have 3 different math extensions being loaded, and the Math extension being loaded in 2 different ways. Probably they are stepping over each other and breaking each other.

My web hosting provider has done that now:

Product Version
MediaWiki 1.30.0
PHP 5.6.33 (litespeed)
ICU 4.2.1

... with the result that there are now a lot of red error messages on the wiki (e.g.http://wiki.glennersterlab.com/index.php/Notation). The messages say: Failed to parse (Missing texvc executable); please see math/README to configure.). but I gather that This feature was removed from MediaWiki core in version 1.18.0 and there is no wgTexvc in my LocalSettings.php. The extensions installed include:  Math 3.0.0 (ba08a3a)04:38, 1 February 2017 and  SimpleMathJax 0.7.1 Thanks for your help. Thank you Bawollf. The javascript console does show useful errors. JQMIGRATE: Migrate is installed with logging active, version 3.0.1-pre /extensions/SimpleMathJax/modules/MathJax/MathJax.js?config=TeX-AMS-MML_CHTML&_=1524499368186 Failed to load resource: the server responded with a status of 404 (Not Found) Notation:1 Uncaught SyntaxError: Unexpected token < at DOMEval (load.php:1) at Function.globalEval (load.php:4) at text script (load.php:130) at ajaxConvert (load.php:120) at done (load.php:125) at XMLHttpRequest.<anonymous> (load.php:129) I then commented out SimpleMathJax from LocalSettings.php and this seems to get rid of the errors in the javascript console but the wiki looks the same (same red error messages). I am no expert, as you can tell. I may have to move providers to get more help. I have now commented out all math lines except wfLoadExtension( 'Math' ); but with no effect. This math extension remains:  3.0.0 (ba08a3a)04:38, 1 February 2017 Thanks again. You are right. That folder (SimpleMathJax/modules/MathJax/) is empty. I will talk to my provider and see if they can install SimpleMathJax properly. Thank you for your help. It is still odd that math on the wiki worked fine before and it broke without me touching anything. Anyway, thank you, I am very grateful for your help. Reply to "Help with math rendering" ## Bots Uploading images on MW Projects 1 Hi everyone, for my project, i need that my bots could upload images on my wiki. reading the manual, i found that i can use the Upload API for this purpose. To do so, i do a call for APIs with a post request that i send to my MW installation: action=upload&filename=myfile.png&url=http://url.of.thefile/myfile.png&token=+\ I'm using content type multipart/form-data because i know, from the manual, that application/x-www-form-urlencoded wouldn't work. The problem is that, even though my Bot is allowed from user group rights to upload files, i cant upload files with it. What did i miss? Any suggestion would be helpful, thanks for your time and happy development! Reply to "Bots Uploading images on MW Projects" ## Adding members to my privat wiki 1 I can not add global users to my privat wiki. In "Global accounts list" the member is mentioned, but at "User rights" I can not find him. How can I add the member? Sometimes it succeeds but that seems coincidence. Reply to "Adding members to my privat wiki" ## substitution alignment 5 I substitute my infoboxes because that's easier for me. I can't for the life of me figure out how to change the alignment without basically creating an entirely new infobox to call upon, which would be super annoying. I've tried adding |align ="left" and |style =leftto the infobox afterward and nothing changes. What can I do? i also do not want to edit common.css they're not copied, no. completely built from scratch. I have a CSS override so that they all align=right but I want some of them to align=left, and that's my problem. If you are using local CSS overrides, than I assume those CSS rules are implemented on-to the Infobox through a class. In which case, can't just two separate classes be made, one for left-alignment and the other for right-alignment? They can, how would I accomplish that? To make it clear: i have one page that I am attempting to use multiple infoboxes on and it looks awful with all of them on the same alignment. I want to change it so that every other box is aligned left. Reply to "substitution alignment" ## Is SemanticWiki the only way to get Topic Tagging? 6 We want to tag our articles (topic-tags, not revision-tags). And then display "Related Articles", based on those tags. This article describes a method using SemanticWiki, https://clkoerner.com/2012/08/28/use-semantic-mediawiki-semantic-forms-to-create-a-folksonomy-for-tagging-related-pages/ but that seems a heavy solution, since we don't need any other SemanticWiki features. Any simpler or, preferably, native method? Can't use Categories, as we're already using Categories as Categories, for organizing and TOC. Thx Categories is the way to go if you don't want SMW. This is exactly the purpose of categories, group similar pages. We consider Categories and Tags to be different concepts. That Folksonomy article agrees. Eg: • Category is Fruit. • Title is Oranges. • Tags are citrus, segmented, juicy, vitamin C, cold prevention, breakfast Or • Category: Books • Title: Cien Años de Soledad • Tags: Spanish, surrealism, Colombia, magical realism, Latin American We use Category as a hierarchical organizing structure. We want articles to appear in only one Category in TOC, but articles can have multiple tags. Tags are non-hierarchical, and can apply across different Categories. We really want tags independent of Categories. Then create a prefix to the category name, to distinguish between your "real" categories and "tags". E.g. have "Category:Tag:Spanish" The differences you cite between tags and categories is all in how you use the feature, and none in how the feature is actually implemented. If it makes you feel better, you can even dowgExtraNamespaces[NS_CATEGORY] = 'Tag'; $wgExtraNamespaces[NS_CATEGORY_TALK] = "Tag_talk"; and then change the pages MediaWiki:nstab-category , MediaWiki:categories, MediaWiki:pagecategories, etc to use the word "Tag". > "create a prefix to the category name", E.g. have "Category:Tag:Spanish"  Thx, but that seems like a complicated, non-intuitive workaround. Tree: This will put all the tags into the CategoryTree. We don't want the tags in the CategoryTree. Entry: We want to apply Tags by simply entering "Spanish" in a "Tags" box. Don't want to enter "Category:Tag:Spanish". Cross-Reference: We want a given tag to apply to multiple Categories. Then show "Related pages" based on Tags. I don't see how to do that with this method. Subcategories: Maybe there's a way to do this with sub-categories. Pro: Tree: CategoryTree has "depth" parameter, which would hide that subcategory "tags" which is good. Con: No, subcategories would be difficult, if we want to allow same tag for multiple categories. That would require adding same subcategory to multiiple categories. Con: I don't see how to cross-reference subcategories across different categories (to show "Related Pages" at bottom of every page, based on subcategory). > "do$wgExtraNamespaces[NS_CATEGORY] = 'Tag'; $wgExtraNamespaces[NS_CATEGORY_TALK] = "Tag_talk"; and then change the pages MediaWiki:nstab-category , MediaWiki:categories, MediaWiki:pagecategories, etc to use the word "Tag".  That throws out Categories, and uses the word "Tag" instead of "Category". Correct? We don't want to throw out the word Category. We want both tags and categories. Extension:RelatedArticles might help. thx Your description still sounds like you basically just want the category system • tree: just make sure the tags dont have the same parent as your "real" categories • entry: just make a page named Template:Tag containing <includeonly>[[category:Tag:{{{1}}}]]</includeonly>. Then you can simply add pages to tags by doing {{tag|Spanish}} • cross-reference: if you mean you want to add a category to a tag to imply that all members in that category should also be in that tag (for the purposes of Special:Recentchangeslinked) thats a little harder. There are some work arounds with extensions that do "deep category intersection". Some people also work around it by using templates to add things to categories that automatically specify the right additional tags, but there really arent great solutions to this. Basically for this method "real categories" and "tags" are entirely separate, and if you want all pages in a specific category to have a specific tag you have to tag them all individually. Re subcategory - Im kind of confused by this-if you were tagging a category, it would be the parent of the category, not the child (subcategory). CategoryTree would ignore it as it doesnt look at backedges i the category graph. Re tags namespace: yeah, thats just renaming category to tag. Reply to "Is SemanticWiki the only way to get Topic Tagging?" ## How to apply wgNamespaceContentModels to ALL namespaces in a single statement? 5 Flow manual says i must apply the following to localsettings.php, for each namespace. $wgNamespaceContentModels[NS_TALK] = 'flow-board';
$wgNamespaceContentModels[NS_USER_TALK] = 'flow-board'; # Do not reassign the global ($wgNamespaceContentModels =)


Extension:StructuredDiscussions#Enabling or disabling StructuredDiscussions

How can i apply wgNamespaceContentModels to ALL namespaces in a single statement?

To enable Flow for all namespaces is a bad idea. If you want to use your wiki as a social site:

$needFlow = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]; foreach ( array_keys($wgExtraNamespaces ) as $key ) {$needFlow[] = $key; } foreach ($needFlow as $value ) {$wgNamespaceContentModels[$value] = 'flow-board'; }  put it to the bottom of your LocalSettings.php. Thx! > To enable Flow for all namespaces is a bad idea. Why? Typically people dont want flow on all namespaces as usually some namespaces are for content and others are for talking. But its really up to you. A shorter version of that is $wgNamespaceContentModels = array_fill( 0, 16, true );


[That said, 星耀晨曦's is a better solution because it takes extra namespaces into account and is less hacky. Although you can do the same with array_fill by replacing 16 with 2000 (since invalid namespaces are ignored)]

Reply to "How to apply wgNamespaceContentModels to ALL namespaces in a single statement?"

## Private Wiki Requires Two Logins

5

Hey,

Whenever anyone on our private wiki tries to sign in, it redirects to the index.php page and then when you try to do anything else it redirects to another login page. I already verified that our $wgServer variable is set properly and I don't know what else to do. It's really annoying, hopefully there's a fix. Cheers o/ Are you using "short" or "pretty" URLs? I mean viewing articles have a different URL structure than when editing (/wiki/ vs /index.php or similar). Because cookie path may be the problem here. See Manual:$wgCookiePath

Oops, forgot to use the reply button. But, for a little more information, when you visit wiki.domain.com it goes to wiki.domain.com/index.php. If you go to domain.com/wiki/index.php it still works the same.

Hi, I'm a little confused on what you mean. Our Wiki is on wiki.domain.com, but the directory is on /wiki. When I tried setting $wgCookiePath, the Wiki didn't load at all. If the wiki doesn't load at all, you made a typo when adding that configuration. Try:$wgCookiePath = '/';

Still, this is the default value and should work for you unless you changed it.

## Extension:CategoryTree Not Updating with Cache Enabled

5

Not finding a solution here.

i've tried purging the page with Extension:Purge, and re-entering the source. Neither makes the tree update.

I'm able to get refresh by turning off caching, and then re-enter the page-source:

$wgEnableParserCache = false;$wgCachePages = false;


However, won't the site performance suffer without caching?

Update: Making a little progress. The following settings are in my LocalSettings.php:

# not sure why tree is not refreshing, if set to NONE! Was default:
$wgMainCacheType = CACHE_NONE;$wgMemCachedServers = [];

# unclear why this is commented by default
# $wgCacheDirectory = "$IP/cache";

# i installed this
require_once "$IP/extensions/MagicNoCache/MagicNoCache.php"; # i added this to ensure caching.$wgEnableParserCache = true;
$wgCachePages = true;  Then i added the magic word __NOCACHE__ to the page containing the Tree. I notice that, with above setting, new pages are added to the Tree, but old copy of moved pages stays in Tree! I'm guessing that might be intended as a convenience (?), but without redirect it's just a dead link. We don't want deleted pages to stay in Tree. Update: Changed$wgMainCacheType to ANYTHING. Now seeing improved performance on pages, but no change in Tree behavior-- deleted pages still showing.

Just set $wgCategoryTreeDisableCache = true; This will cause the parser cache to be disabled on all pages that use categorytree (You can still potentially have browser cache or file cache (if you enable file cache, its not on by default) giving stale results, but that's much less likely). i set$wgCategoryTreeDisableCache = true;

A little progress:

Tree is no longer showing deleted pages.

But tree is not showing moved pages. The old version of the moved page is in the tree, not the new version. (i moved the page to a different namespace).

API and Special:CategoryTree shows the page (Peaches) has been moved to new namespace (Main) from previous namespace (Draft):

However, Tree shows the page still in it's old namespace (Draft):

https://gunretort.xyz/index.php/Portal:Table_of_Contents

Reply to "Extension:CategoryTree Not Updating with Cache Enabled"

## MobileDetect with images

1

I've put the extension https://www.mediawiki.org/wiki/Extension:MobileDetect and it is embedding the texts perfectly, but the images are not scaling.

For the images I use the following:

Are there any other items that should be parameterized in the extension? Or should I change the inclusion of the images?