Project:Support desk

Jump to navigation Jump to search

About this board

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

There are also other places where to askCommunication: IRCCommunication#Chat, mailing listsMailing lists, Wikimedia Developer Support, Q&A, mwusers (unofficial forum) etc.

Before you post

Post a new question

  1. To help us answer your questions, please always indicate which versions you are using (reported by your wiki's Special:Version page):
    • 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".

MediaWiki 1.32.0-RC0 fails with MSSQL

2 (talkcontribs)

Windows 2008 R2 IIS 7.5

MS-SQL 2012

MediaWiki 1.32.0-RC0 (11-09-2018)

I had tried 1.31.1 but from reading found it doesn't support MS-SQL at all because of issues with it and it was being fixed in 1.32.0 release. Looking in GIT I saw most of those issues resolved. When I first try to install there's an error on table creation, it looks like a comma was left out of the tables.sql file.

maintenance\mssql\tables.sql line 1044

rc_patrolled tinyint NOT NULL CONSTRAINT DF_rc_patrolled DEFAULT 0

I added the comma to the end in that file and started the entire process over after deleting and remaking a blank DB. After fixing that though it installs the DB and moves on but errors after that.


Setting up database... done

Creating tables... done

Creating database user... done

Populating default interwiki table... done

Initializing statistics... done

Generating secret keys... done

Prevent running unneeded updates... done

Creating administrator user account... done

Creating main page with default content... failed


Could not create a new page. It already exists.

Malyacko (talkcontribs)
Reply to "MediaWiki 1.32.0-RC0 fails with MSSQL" (talkcontribs)

I installed HeadScript and see it in extensions. (I downloaded and added the line require_once "$IP/extensions/HeadScript/HeadScript.php";)

When I try to add any script like it is advised in the manual

$wgHeadScriptCode = <<<'START_END_MARKER'


It immediately kills the whole site. "The page cannot be displayed" occurs everywhere. This doesn't depend on script, whatever I put between <script></script> have the same effect.

Please, advise how to fix that.

Malyacko (talkcontribs)

Please tell us if there is any further information in your webserver's error log why the page cannot be displayed, and which MediaWiki version this is about.

Reply to "HeadScript kills the site"

What is the best way to have mobile friendly site?

Summary by Malyacko

Duplicate posting

Zeynel1 (talkcontribs)

What is the best way to have mobile friendly site?

Zeynel1 (talkcontribs)
Malyacko (talkcontribs)

If "it did not work" you could explain why it did not work.

Reply to "What is the best way to have mobile friendly site?"

modifiedby field not working since update

1 (talkcontribs)

I previously created a dpl to help me with my maintenance jobs on a wiki. Some time ago we got an update to the last version and it caused all dpl's that used the modifiedby field to throw up this error.

The DPL extension (version 2.3.0) produced a SQL statement which lead to a Database error.

The reason may be an internal error of DPL or an error which you made,

especially when using DPL options like titleregexp.

Query text is:

SELECT DISTINCT `wdd_page`.page_namespace AS page_namespace,`wdd_page`.page_title AS page_title,`wdd_page`.page_id AS page_id, rev_user, rev_user_text, rev_comment, rev_timestamp, rev_id FROM `wdd_revision` AS rev, `wdd_revision` AS change_rev, `wdd_page` INNER JOIN `wdd_categorylinks` AS cl0 ON `wdd_page`.page_id=cl0.cl_from AND (cl0.cl_to='5e') INNER JOIN `wdd_categorylinks` AS cl1 ON `wdd_page`.page_id=cl1.cl_from AND (cl1.cl_to='User') LEFT OUTER JOIN `wdd_categorylinks` AS cl2 ON `wdd_page`.page_id=cl2.cl_from AND cl2.cl_to='Meta' WHERE 1=1 AND cl2.cl_to IS NULL AND `wdd_page`.page_namespace NOT IN ('1') AND `wdd_page`.page_is_redirect=0 AND `wdd_page`.page_id=rev.rev_page AND rev.rev_timestamp=( SELECT MAX(rev_aux.rev_timestamp) FROM `wdd_revision` AS rev_aux WHERE rev_aux.rev_page=rev.rev_page ) AND = change_rev.rev_user_text AND change_rev.rev_page = page_id AND `wdd_page`.page_id=rev.rev_page AND rev.rev_timestamp < 20181117160000 ORDER BY rev_timestamp DESC, rev_id DESC

Error message is:

Column 'rev_user' in field list is ambiguous (

When the following is inputted:

{{#dpl:|allrevisionsbefore=201811171700|ordermethod=lastedit|order=descending|distinct=true|category=User|notnamespace=Talk|notcategory=Meta|modifiedby=ConcealedLight|noresultsheader=|mode=userformat|format=,\n* %DATE% %PAGE%}}

Any suggestions?

Reply to "modifiedby field not working since update"

Password protection in .htaccess asks for password in every directory accessed

Domenixq (talkcontribs)

I'm working on a private wiki instance on a shared host for a student organization. I'd like the wiki to be able to be read by anyone in the team who knows the password without the need to create a user just for that. Contribution is limited to registered users only.

I am using URL shortening and HTTPS redirection too, and currently it asks for password again not only when the main page is loaded but also when the logo is loaded and the first load.php command is ran, so three times usually. Sometimes it asks seemingly randomly also while browsing the wiki.

It is very annoying, and I contemplated on somehow extending MediaWiki to contain a landing page for password and then register the session and keep it until cookies are cleared. I couldn't find an Extension for what I am trying to do. I'd rather stick to .htaccess in case there is no such Extension available at all.

The content of the .htaccess file is the following:

RewriteEngine On

# Always redirect HTTP to HTTPS

RewriteCond %{HTTPS} off

RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]

<If "%{HTTPS} == 'on'">

    AuthType Basic

    AuthUserFile /var/www/

    AuthName "Username and password required"

    Require user exampleuser


RewriteRule ^/?wiki(/.*)?$ /index.php [L]

RewriteRule ^/*$ /index.php [L]

I am using MediaWiki 1.31.0.

Reply to "Password protection in .htaccess asks for password in every directory accessed"
VOIstri (talkcontribs)


When links are produced with the ref tag, they are small numbered "boxes". Is there a way to change this to be the same size as the text itself? Basically, to produce links like how latex creates them?


This post was hidden by (history)
AhmadF.Cheema (talkcontribs)

Maybe Extension:CrossReference will suit your purpose?

To edit how references are rendered, you will need to edit particular MediaWiki messages, a list of those related to cite references is available from here.

MediaWiki:Cite reference link will be the one relevant for your purpose. Using <span> instead of <sup> will level the reference tags, after which one CSS rule addition to MediaWiki:Common.css will be required to change the font-size from the present 80% to 100%.

VOIstri (talkcontribs)

Hi. Sorry for the lack of reply. I will take a look, but I can't really tell from the description exactly what that extension will do. It looks like it allows for a different type of reference rather than amending the way mediawiki renders references. I might just try poking around the code, since I can see that it's the result of the sup tag being used. The problem is that if I hack the core code to remove it there's no knowing what it might mess up...

Thanks anyway.

AhmadF.Cheema (talkcontribs)

If by "core code", you mean MediaWiki's core code, then it is definitely recommended against. There isn't even any need for such here.

As mentioned above, in the source code of your Wiki's MediaWiki:Cite reference link page, change <sup> to <span> and then add the following in your Wiki's MediaWiki:Common.css:

span.reference {
	font-size: 100% !important;
VOIstri (talkcontribs)

Ah, sorry I don't know how I missed that; I must have been too distracted to read your reply properly, I'm sorry. But, that that's what I needed to know, thanks! I can probably amend the CSS to tweak exactly how I want it to look.

Thanks a lot! You've been a real help.

[Solved] Help with columns?

Summary by AhmadF.Cheema

Extension:ParserFunctions was not running. (talkcontribs)

How does one go about making the content of a page auto flow into two columns? I have used multicol in the past but I understand this is being deprecated?

What is the current, correct way to create columns? I tried colbegin, div col, colstart, and some others but they ether do nothing or display something like "Template:Columns Start" in red.


AhmadF.Cheema (talkcontribs) (talkcontribs)

I took a look at < title=Template:Div_col&action=edit > on my site vs the wikipedia one referenced from the link you added. They payload looks quite different. (this is a fresh install of the mediawili docker container with my data migrated).

FWIW, div col is the one that doesn't seem to do anything... the text is still in single column mode.

Is it just a matter of copying and pasting from the link to mine and saving? Is this how templates are supposed to be dealt with? I guess I'm worried about breaking something.

AhmadF.Cheema (talkcontribs) (talkcontribs)

Thanks for the link. I was able to get the template exported/imported successful once I figured out what to do with the interwiki prefix and installing extension Scribunto.

Using \{\{div col\}\} still doesn't work though. Just doesn't do anything to the flow of the text - like it's ignored.Loading the doc page locally it appears messed up - like the columns are not set properly, element placement off - like it's missing CSS styles.

I'll have to dig into it further. If you have any insights it would be appreciated.


AhmadF.Cheema (talkcontribs)

You need to include in your Wiki's MediaWiki:Common.css the following from MediaWiki:Common.css:

/* Reset top margin for lists embedded in columns */
div.columns {
	margin-top: 0.3em;
div.columns dl,
div.columns ol,
div.columns ul {
	margin-top: 0;

/* Avoid elements breaking between columns */
div.columns li,
div.columns dd dd {
	-webkit-column-break-inside: avoid;
	page-break-inside: avoid;
	break-inside: avoid-column;

However, there probably are more CSS rules that need to be added too, not sure where to find them, though.

Also, when importing did you remember to "[c]heck the box 'Include templates'"? (talkcontribs)

Ah, yes - that makes sense. I did include the related templates on the export and it brought over a few dozen (more?) related templates and modules so I think I'm good that way. Your CSS comment makes a lot of sense.

I am off site today so won't be able to mess with it till tonight/tomorrow.

Thanks again. (talkcontribs)

Still pulling my hair out with this. I went back and grabbed some more templates via exporting Templates:Col-Begin and then Templates:Columns. Ended up having to add extension TemplateStyles but still did not have any luck getting {{div col}} to work.

After doing a bunch of hand edits back and forth between this site and my site's Common.css I just gave up and inserted this site's Common.css in its entirety and it didn't make any difference. I realize this might be breaking other things but the site renders ok otherwise. I have the original to revert if needed.

So... not sure what to try next. Learning a lot about dealing with the official Mediawiki docker container though between adding extensions, tuning php.ini and having to add php composer to install extensions and whatnot (TemplateStyles). (talkcontribs)

Just in case it points out something that is wrong with my setup... I just attempted to replace {{div col}} with {{col-begin/break/end}} and it didn't do any change to the colums (still single) however it spit out a bunch of css rubbish at the {{col-break}} point ( width: {{{width}}}; }}text-align: left; vertical-align: top; " | ) and col-break is nowhere to be seen.

This must mean broken CSS somewhere?

AhmadF.Cheema (talkcontribs)

Are you using a large screen size device like a PC or laptop, or a mobile phone? Small screen sizes might not show any changes.

Use the element selection tool in browser developer tools (in Chrome, press Ctrl+Shift+C) and select the portion which should render as columns. Does its styles contain something of the sort of -moz-column-width, -webkit-column-width, or column-width? (talkcontribs)

I'm working on Firefox on a full size Mac or Linux desktop depending on location....

This is the kind of stuff I am seeing in Inspector:

(link to screenshot)

If I toggle the first element in the centre column to off the page renders properly.

I'm not that great with CSS but that looks like a mess to me... and would explain why it is doesn't work I guess.

Where else should I look besides Common.css OR how can I determine if I am missing a template, extension, module, whatever?

Thanks again.

AhmadF.Cheema (talkcontribs)

I just test imported Template:Div col, and everything appears to work fine.

The Inspector results are quite odd. Exactly what are you entering on the Wiki page to get the column template to render? (talkcontribs)

I'm not sure why this is different. I should mention, this used to work beautifully and then I did an upgrade from 1.29.? to 1.31.current... and this hasn't worked since then.

I've been upgrading this wiki from version to version for quite a few years.

Anyway, I'm not doing anything weird with the tags - at least I don't think I am. I'm not even using a visual editor - hand inputting the tags. I'm just wrapping lines of text with {{div col}bunch of text over a few dozen lines{{div col end}}.

I'll see if I can spend some more time trying to figure out what all is installed templates, modules, etc. and go from there. I'll take a look at what the pages look like inside the DB as well. (talkcontribs)

Solved it!

I did all kinds of things like removing all templates from the site, re-adding, etc. but in the end PEBKAC (Problem exists between keyboard and chair).

If anyone stumbles up this this thread in the future and sees rubbish in your displayed pages like:

{{#ifeq:div col |doc 

{{#ifeq:show |show
}}{{#if:||{{#ifexist:Template:Div col
                  | [[Category:{{#switch:Template |Template=Template |Module=Module |User=User |#default=Wikipedia}} documentation pages]]

Then the problem is the Parser Functions Extension is not working!

In my case when I spun up my container I had a problem with the version of the Parser Functions I downloaded (master vs v1.31 version - geez, I know better). It broke my site so I removed the require from my LocalSettings.php and then promptly forgot all about it while I got the docker container with mysql moved to a different host, imported some other data, etc., etc. That was probably two weeks ago.

At least I got a decent error in the error.log

[Sat Nov 17 03:02:58.912389 2018] [php7:error] [pid 16] [client] PHP Fatal error:  Uncaught ExtensionDependencyError: ParserFunctions is not compatible with the current MediaWiki core (version 1.31.1), it requires: >= 1.32.0.\n in /var/www/html/includes/registration/ExtensionRegistry.php:278\nStack trace:\n#0 /var/www/html/includes/registration/ExtensionRegistry.php(158): ExtensionRegistry->readFromQueue(Array)\n#1 /var/www/html/includes/Setup.php(116): ExtensionRegistry->loadFromQueue()\n#2 /var/www/html/includes/WebStart.php(88): require_once('/var/www/html/i...')\n#3 /var/www/html/index.php(39): require('/var/www/html/i...')\n#4 {main}\n  thrown in /var/www/html/includes/registration/ExtensionRegistry.php on line 278, referer: <nowiki>

<le_sigh />

Anyway, thanks for all the help.

Unable to Install Math Extension

Summary by AhmadF.Cheema

Needed to run the Update.php script.

Zeynel1 (talkcontribs)

MediaWiki Version:1.31.1


I tried to follow the manual install as explained here Extension:Math#Installation

But when I tried to upload the extension to the server some files gave an error "An unknown error occurred? Are you over quota?" I contacted the hosting company (A2 Hosting), they said I'm not over quota and that I should contact MediaWiki. Can you help?

I also I did not understand the installation explained here:

I don't understand this: "

"For wikis connected to the internet: Simply download the latest versions for both of Mediawiki core [1] and the Math extension [2] and that's it."

MediaWiki is already downloaded and installed. I downloaded and extracted the Math extension, but that's in my computer. I don't get it.

Thanks for the help.

2001:16B8:1093:E500:FC68:97BC:1DEA:79CA (talkcontribs)

You need to download and extract the extension into the extensions/ folder in your MediaWiki installation.

Afterwards you should be able to activate it by adding it to LocalSettings.php as explained in Extension:Math#Installation. Afterwards, the extension must appear on the Special:Version page of your wiki.

AhmadF.Cheema (talkcontribs)

If A2 hosting is not allowing something to upload to their servers, the issue would be at their end. Are you trying to upload the extracted files of the extension instead of the compressed/archived file? If so, upload the extension archive and then extract it on the server, the A2 hosting file upload might have some issues with uploading multiple files.

Regarding your second question, I don't think I understand. MediaWiki core and extension are supposed to be in your account on the A2 hosting server, there is no need to have them on your computer?

Zeynel1 (talkcontribs)

Thanks. I was able to install the extension. I see it on the Special:Version page I ran the update script in the browser. I added wfLoadExtension( 'Math' ); to LocalSettings.php. But I get this error when I try to load a page with <math>...</math> markup:

MediaWiki internal error.

Original exception: [W@8G6fD124hne5zGvGezuwAAAEg] 2018-11-16 18:05:31: Fatal exception of type "Wikimedia\Rdbms\DBQueryError"

Exception caught inside exception handler.

Set $wgShowExceptionDetails = true; and $wgShowDBErrorBacktrace = true; at the bottom of LocalSettings.php to show detailed debugging information.

It looks like a database error but I don't know what I need to do. Thanks for the help.

AhmadF.Cheema (talkcontribs)

As the error says, set "$wgShowExceptionDetails = true; and $wgShowDBErrorBacktrace = true; at the bottom of LocalSettings.php to show detailed debugging information."

Zeynel1 (talkcontribs)

I added

"$wgShowExceptionDetails = true;

$wgShowDBErrorBacktrace = true;

at the end of LocalSettings.php

But now I get no errors at all, just a blank page. When I comment out those two lines I get the same error again.

AhmadF.Cheema (talkcontribs)

See Manual:How to debug for details. Include the following too:

$wgDevelopmentWarnings = true; error_reporting( -1 ); ini_set( 'display_errors', 1);

Zeynel1 (talkcontribs)

Hi. Now I have these at the end of LocalSettings.php:

$wgShowExceptionDetails = true;

$wgShowDBErrorBacktrace = true;

error_reporting( -1 );

ini_set( 'display_errors', 1 );

But I get no error reporting. Just a blank page.

So I have <math>...</math> tags in a page and when I try to save it I get a blank page.

Can I remove the extension and try to install it again?

Zeynel1 (talkcontribs)

I added $wgDevelopmentWarnings = true; too. Nothing changed.

I have this:

$wgShowExceptionDetails = true;

$wgShowDBErrorBacktrace = true;

$wgDevelopmentWarnings = true;

error_reporting( -1 );

ini_set( 'display_errors', 1 );

Zeynel1 (talkcontribs)

I ran the update script from the command line and it is working now. Thanks!

MW serving wrong page with random content, how to debug?

Zoglun (talkcontribs)

It seems that there are bug/bugs in Mediawiki 1.31 cache system. Where sometimes page will show totally different page than it currently is, and with page refresh/purge. the random content may change to other random page or change back.

Moreover, some times that page content will change to totally different template contents after submit, which made many edit lost and cause editors mad.

How to debug? Is anyone have similar bug like us in MW 1.31 or earlier version?

Reply to "MW serving wrong page with random content, how to debug?"