Project:Support desk

Jump to: navigation, 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, 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".

Certain Articles With Coordinates Not Showing in Location API Queries

PhilEH (talkcontribs)

Hello, I'm currently working on a project using the MediaWiki Location API to find locations near a specific GPS coordinate. The API works great! Edits to an article's coordinates are updated immediately using the API which is also great. But there are some articles which have GPS coordinates, but don't show up in the API queries. An example would be The Mont Royal Chalet in Montreal. I was wondering how to go about editing the page to ensure it shows up when using the API.


Reply to "Certain Articles With Coordinates Not Showing in Location API Queries"

PHP Warning: posix_uname() has been disabled for security reasons in /includes/GlobalFunctions.php on line 1496

2A04:2413:8300:8480:4C8A:204B:9AD4:1FFF (talkcontribs)

PHP Warning: posix_uname() has been disabled for security reasons in /includes/GlobalFunctions.php on line 1496

Is the following fix safe/ok?



if ( function_exists( 'posix_uname' ) ) {

// This function not present on Windows

$uname = /*posix_uname()*/ false;

} else {

instead of

if ( function_exists( 'posix_uname' ) ) {

// This function not present on Windows

$uname = posix_uname();

} else {

星耀晨曦 (talkcontribs)

Make sure you do not turn on safe mode or disable this function in php.ini.

Ciencia Al Poder (talkcontribs)

If a safe function like posix_uname is disabled on your installation, I imagine others will be as well. You probably won't be able to run MediaWiki on that host.

2A04:2413:8300:8480:B585:F64D:2BEF:8506 (talkcontribs)

@ Ciencia Al Poder Media wiki 1.30 works just fine. That function is blocked on my shared host.

2A04:2413:8300:8480:B585:F64D:2BEF:8506 (talkcontribs)

@星耀晨曦 I'm on a shared host and this function is disabled. Is my modification ok or not? Until now I don't see any errors or warnings in the logs.

Ciencia Al Poder (talkcontribs)

Your modification seems ok, although this is very weird

Reply to "PHP Warning: posix_uname() has been disabled for security reasons in /includes/GlobalFunctions.php on line 1496"
Ycsoft (talkcontribs)

Hello -I am currently in version 1.25.3 on a hosted server ( -I am trying to create a page where the user could click on a link to download a file. (for example, on a page dedicated to the hike, the user could download a rando.gpx file which he could then load into his GPS to view a trace) -I have an example of this type of link in mediawiki (, but I can not implement it (see my page -Can anyone help me ? Greetings

Ciencia Al Poder (talkcontribs)

This is not something MediaWiki can do directly, because that is a direct link to a file on the server. You should configure it on the webserver.

I see the .gpx file is served with Content-Type: text/plain. You probably want to tell the webserver (apache, apparently), to serve it with an appropriate content-type, which apparently should be "application/gpx+xml". See this little guide that I found:

With this change, normally the browser won't understand how to open that type of file and offer it for download directly.

2001:16B8:103C:5F00:D822:1420:377A:A3C5 (talkcontribs)

Isn't the Media namespacw ehat you want?

E.g. You upload your file through the uplod function of MediaWiki (which might need some configuration to allow your file type/mime type). Then you can link the file directly using the Media namespace like so: Media:Wiki.png. This will link to the file directly instead of to the description page.

Reply to "create a download link"
Yonidebest (talkcontribs)

Hi, I would like to add an onclick event to all external links on my wiki so that I can track the clicks with google analytics. My problem is that I can't find the php page and function where the external links are generated. Could anyone point me in the right direction?


Osnard (talkcontribs)

You could probably use Manual:Hooks/LinkerMakeExternalLink hook.

Yonidebest (talkcontribs)

I'm not actually proficient in php, I can't build new extensions and I have no idea where and how to use hooks. I thought I could just add the needed text to the php page which parses the external links - there must be a function for that somewhere? Is it not a good idea?

2001:16B8:103C:5F00:1912:75CC:7173:6850 (talkcontribs)

Modifying the source code is evil - don't do that. It will e.g. make updates harder or even impossible.

Using the LinkerMakeExternalLink hook also sounds like an idea to me. According to the manual page, you can add your code in the &$attribs variable inside the hook function...

Reply to "Tracking all external links"
Simon Shortman (talkcontribs)

Tried multiple times to follow SQL server install instructions, have created the schema by hand and it works for same credentials so don't know why this is failing! Also would be great to add to existing DB given one can specific schema/prefix.

Setting up database...

A database query error has occurred. This may indicate a bug in the software.

  • Query: CREATE SCHEMA [Wiki]
  • Function: MssqlInstaller::setupDatabase
  • Error: 15247 [SQLSTATE 42000][Error Code 15247][Microsoft][ODBC Driver 11 for SQL Server][SQL Server]User does not have permission to perform this action. [SQLSTATE 42000][Error Code 2759][Microsoft][ODBC Driver 11 for SQL Server][SQL Server]CREATE SCHEMA failed due to previous errors.


#0 D:\home\site\wwwroot\includes\db\Database.php(1076): DatabaseBase->reportQueryError('[SQLSTATE 42000...', 15247, 'CREATE SCHEMA [...', 'MssqlInstaller:...', false) #1 D:\home\site\wwwroot\includes\installer\MssqlInstaller.php(508): DatabaseBase->query('CREATE SCHEMA [...', 'MssqlInstaller:...') #2 [internal function]: MssqlInstaller->setupDatabase(Object(MssqlInstaller)) #3 D:\home\site\wwwroot\includes\installer\Installer.php(1592): call_user_func(Array, Object(MssqlInstaller)) #4 D:\home\site\wwwroot\includes\installer\WebInstallerPage.php(1419): Installer->performInstallation(Array, Array) #5 D:\home\site\wwwroot\includes\installer\WebInstaller.php(280): WebInstallerInstall->execute() #6 D:\home\site\wwwroot\mw-config\index.php(77): WebInstaller->execute(Array) #7 D:\home\site\wwwroot\mw-config\index.php(36): wfInstallerMain() #8 {main}

I'm actually installing against AzureSQL but this should look exactly like any SQL Server. (talkcontribs)

Instead of trying to solve the permission problem, I want to tell you this: While MediaWiki in fact should work with MSSQL, its MSSQL support is way less mature than the MySQL support. So if you are setting up a new database system now anyway, I recommend using MySQL (or MariaDB if you like). MediaWiki will run with less trouble and - should you have questions - it will be way easier to get support from the MediaWiki community as basically everyone uses MySQL (or MariaDB), while nearly no one uses MSSQL.

Ciencia Al Poder (talkcontribs)

See also task T113831 (talkcontribs)

As you can see in the task, Skizzerz, who implemented MSSQL support, is talking, but I have not seen a single patch. So at least currently this seems to me like he has no definite plans to make it working in versions other than 1.23. Based on the reading in this phabricator task, I tend to change my "MSSQL should work" to a "MSSQL might work, partly maybe only by accident and you absolutely cannot expect it to continue working in current and even less in future versions".

And to make this very clear: There has not been a single patch up to now, but even if there would be patches to make MediaWiki work better with MSSQL, there are absolutely no plans to make 1.26 compatible as well. I strongly discourage using MediaWiki 1.26 with MSSQL.

Simon Shortman (talkcontribs)

Thanks for insights. I had planned to use MySQL. The Installer though gave the option for MSSQL so I thought I'd give it a go. Perhaps the installer should present options based on version/db-engine compatibility and not provide unsupported install options - that confuse novices ?

I guess one could regress to 1.23, for now (it's for experimental use anyway) and look for future supported compatibility when it arrives. Based on the experiment we can redeploy as MySQL. Once assumes any setup and data can be migrated from MSSQL to MySQL as the schemas are logically similar?

Ciencia Al Poder (talkcontribs)

If you plan to use MediaWiki once MediaWiki 1.23 will be no longer supported (May 2017), don't use MSSQL.

Support for MSSQL in LTS version is for supporting those that created their wiki while it was supported, to provide at least an LTS version instead of running an old and insecure wiki.

Simon Shortman (talkcontribs)

1.23.14 did not work anyway...still errors out trying to create tables in the wrong DB (Master), so will revert to MySQL

Thanks All!

Liruqi (talkcontribs)

Looks like we need to grant permission before creating schema,

星耀晨曦 (talkcontribs)

Unless you are using root, you should grant rights after created a new database account.

Reply to "1.26.3 installation - SQL Server"

Hire someone to customize Media Wiki for me

MichaelSel (talkcontribs)


I was wondering if there's a service available (or maybe an individual) that can help me setup a Media Wiki with custom Special Pages and all that?

My PHP is existent, and I am struggling to get what I need out of Media Wiki.




AhmadF.Cheema (talkcontribs)

See Professional development and consulting#Individual professional developers and consultants.

Reply to "Hire someone to customize Media Wiki for me"
QW-IT (talkcontribs)

I upgraded from 1.29.2 and my home page shows the above error. When adding $wgShowExceptionDetails = true; to LocalSettings.php it shows:

[WjJJfceL4-oH1A7c06pIeQAAAEs] index.php?title=Main_Page TypeError from line 4711 of /home/../includes/parser/Parser.php: Argument 2 passed to Parser::setHook() must be callable, string given, called in /home/../includes/StubObject.php on line 111


#0 /home/../includes/StubObject.php(111): Parser->setHook(string, string)

#1 /home/../includes/StubObject.php(137): StubObject->_call(string, array)

#2 /home/../LocalSettings.php(181): StubObject->__call(string, array)

#3 /home/../includes/Setup.php(855): wfMathtag()

#4 /home/../includes/WebStart.php(114): require_once(string)

#5 /home/../index.php(40): require(string)

#6 {main}

The mw-config web upgrade shows that it completed the upgrade successfully, but I can't reach any pages. Any ideas?

Ciencia Al Poder (talkcontribs)

This looks like at least one of your installed extensions is not compatible with your MediaWiki version. When upgrading MediaWiki, be sure to upgrade your extensions as well.

Reply to "Fatal exception of type "TypeError""
Sms.keval (talkcontribs)

How can I auto login user with username and password.

For example If I hit to this URL, how wikimedia will login the user?

URL - http://localhost/mediawiki/

POST Method - username=abc&password=abc

Ciencia Al Poder (talkcontribs)

Currently you'll need 2 requests: One to get a valid login token, and a second to provide the credentials with the previous login token and session cookie. If you want to do it programmatically you should use Api:Login

Reply to "Auto login with Username and Password"
Summary by Ciencia Al Poder

Old topic, please create a new one

Rp2dph19md4hzea (talkcontribs)

Hello, how can I activate to upload and "txt" file to my wiki? Thank you. (talkcontribs)

See Manual:Configuring_file_uploads#Configuring_file_types.

Please note that allowing txt files (and basically any kind of text files) is a potential security problem for the users of your wiki.

Rp2dph19md4hzea (talkcontribs)

Hello, I add on file LocalSettings.php

# Add new types to the existing list from DefaultSettings.php

$wgFileExtensions[] = 'txt';

But when upload TXT file on site I receive error

The file extension "..." does not correspond to its MIME-type (chemical / x-mdl-rgfile).

and upload is stooped, can you consult? Thank you. (talkcontribs)

If you want to upload files with MIME type chemical / x-mdl-rgfile, then you will have to allow this MIME type. Does Manual:MIME type detection help?

Rp2dph19md4hzea (talkcontribs)

I upload on my wiki file.txt and receive that message

Rp2dph19md4hzea (talkcontribs)

I add to "LocalSettings.php" "$wgVerifyMimeType = false;", but anyway I ca not upload txt file.

Rp2dph19md4hzea (talkcontribs)

The problem is in TXT file encoding, I create a demo TXT file and I can upload that file to my wiki, but another TXT file I can not upload, why?

This comment was hidden by (history)
This comment was hidden by AhmadF.Cheema (history)
Paulo.adrp (talkcontribs)

Hello everyone, good morning.

I recently installed MediaWiki Software on my localhost for testicles. I'd like to know more stuff before activating it on my site.

1ª I would like to know how I can edit the template of my MediaWiki, and I speak the tags in HTML, I can not find, where it is. I want to add some things on the homepage and login and on other pages as well. I'm using the MonoBook theme.

2ª I would also like to know where I can edit the CSS of my theme.

3ª I would like to know if it is possible to put the same editor as the Wikipedia encyclopedia.

Thank you in advance.

Ciencia Al Poder (talkcontribs)
  1. You should be more specific about what do you want to do. The "main page" is a page like any other, you can edit it. If you want to add something to the existing interface, there are some Hooks you can use to add specific HTML to certain places. Editing the existing PHP files is generally discouraged.
  2. See Manual:Interface/Stylesheets
  3. See Extension:VisualEditor
Reply to "Edit MediaWiki HTML and CSS template"