Project:Support desk

About this board

Welcome to the MediaWiki Support desk. This is a place where you can ask any questions you have about installing, using or administrating the MediaWiki software.

(Read this message in a different language)

See also

Before you post

Post a new question

  1. To help us answer your questions, please indicate which version of MediaWiki you are using, as found on your wiki's Special:Version page:
  2. If possible, add $wgShowExceptionDetails = true;error_reporting( -1 );ini_set( 'display_errors', 1 ); to LocalSettings.php in order to make MediaWiki show more detailed error messages.
  3. Please include the web address (URL) to your wiki if possible. It's often easier for us to identify the source of the problem if we can see the error directly.
  4. To start a new thread, click the box with the text "Start a new topic".

1.39 how to setup mobile skin?

5
2003:C2:3F21:FD00:9449:AC0F:F20E:94B7 (talkcontribs)

Mediawiki 1.39.6, PHP 7.4.3, MySQL 8.0.36

wfLoadExtension( 'MobileDetect' );
wfLoadExtension( 'MobileFrontend' );
wfLoadSkin( 'MinervaNeue' );
$wgMFDefaultSkinClass = 'SkinMinerva';
$wgDefaultMobileSkin = 'MinervaNeue';
$wgMinervaEnableSiteNotice = true;
$wgMFAutodetectMobileView = true;
$wgMFEditorOptions = array(
        'anonymousEditing' => false,
        'skipPreview' => false
);


Till 1.35 we used to have MinervaNeue as mobile skin. With 1.39, this doesn't work anymore. Mobile devices apparently use the vector skin. What will i have to do to make the mobile skin work?

The mediawiki logfile is full of thousands of lines which don't say nothing to me, by filtering "mobile" i found one interesting line:

[resourceloader] Module "ext.MobileDetect.mobileonly" not loadable on target "mobile".

???

Bawolff (talkcontribs)

Do you have the correct versions of all your extensions? You need 1.39 version of Minerva and MobileFrontend etc.

2003:C2:3F21:FD00:E5D4:4DFC:FAFA:3692 (talkcontribs)

I am quite sure. MobileDetect 2.2 (fc3a66e) 18:49, 11. Feb. 2024, MobileFrontend 2.4.0 (7dc20b0) 07:36, 4. Mär 2024, MinervaNeue – (d515f6a) 08:24, 29. Apr. 2024

These are the versions I get when using ExtensionDistributor and SkinDistributor using target "1.39"

In the desktop browser, skin MinervaNeue has got the look. After login, of course. On my mobile, the skin is s.th. like vector, whether I am logged in or not. This means even when I select MinervaNeue in my user preferences!

Certainly the problem is sitting here in front of my screen, but I've got no more ideas where to look.

Pspviwki (talkcontribs)

How about $wgDefaultMobileSkin = 'minerva';

2003:C2:3F3F:4A00:49D7:2504:A269:1D1 (talkcontribs)

This answer is not helpful. In fact, may you be volunteers or not, this is exactly the kind of answer that makes me angry. This is exactly the kind of support that is superfluous. "Why do you want to use x, use y" is intolerable.

We used to have MinervaNeue as mobile skin for years and years. It used to work for years and years. Now with the upgrade it does not work anymore. You tell me I should use another skin. I am upset, i am outraged. If it does not work THEN DO NOT OFFER IT.

Reply to "1.39 how to setup mobile skin?"

css for Vector-2022

5
2003:C2:3F21:FD00:516D:5391:79D1:A338 (talkcontribs)

Where shall I place my css modifications for the new Vector (2022) skin? I've tried MediaWiki:Vector-2022.css

but it has no effect.

Ciencia Al Poder (talkcontribs)

It may take some time to take effect, usually 20 minutes at most. Otherwise, a syntax error in that page may render the entire CSS or from one point to the end unusable. For example, if you forgot to open or close curly braces. You may want to check if the CSS of that page is valid running it through an online CSS validator.

2003:C2:3F21:FD00:48AC:4A02:818F:D381 (talkcontribs)

Sorry, no, there must be another reason. The same css code works fine as "User:MyUser/vector-2022.css" and does not work as "MediaWiki:Vector-2022.css"

Any other ideas? It is Mediawiki 1.39.6

Ciencia Al Poder (talkcontribs)

$wgUseSiteCss may be false, it fails only on restricted pages and $wgAllowSiteCSSOnRestrictedPages is false, or MediaWiki:Vector-2022.css or MediaWiki:Common.css (!) contains other CSS with syntax errors that renders the entire CSS unparseable (since both stylesheets are concatenated together).

Check also the browser's developer console

2003:C2:3F3F:4A00:49D7:2504:A269:1D1 (talkcontribs)

We don't use $wgUseSiteCss, so it is true by default.

It is the CSS code itself that does not work, but I am helpless why. CSS is nothing that I understand, the code came into being by copy&paste and a lot of try&error. It reads:

.mw-body {
    position: relative;
    z-index: 0;
}
.mw-body-content {
    position: static;
}
.perrypedia_translator {
    display: inline-block;
    position: absolute;
    top: -3.8em;
    right: 0;
}

We use it to position some icons right beside the article title (via top-notice-ns). This works with serveral skins, CologneBlue, DarkVector, Modern, Timeless, and the old vector skin. Of course the "top" value is different in each skin's css. Only with Vector-2022 it does not do anything, no matter which value.

On the other hand, some other css that I inserted into MediaWiki:Vector-2022.css does work perfectly well.

Reply to "css for Vector-2022"

Images not shown - "you don't have permission to access this resource"

6
FipsStel (talkcontribs)

I am not seeing the images I am uploading into my wiki.

I am getting the following message when clicking on an image.

"you don't have permission to access this resource.Server unable to read htaccess file, denying access to be safe"

So, it's about permissions, but where can I change them?


I am using MediaWiki 1.39.1.

Bawolff (talkcontribs)

So it sounds like the permissions of a .htaccess file. You should be able to change it from the command line with chmod (e.g. chmod a+r /var/www/html/w/images/.htaccess assuming your wiki is installed in /var/www/html/w/ ).

FipsStel (talkcontribs)

This needs to be inputed into the .htacess?

Bawolff (talkcontribs)

No. The permissions on the .htaccess file need to be changed.

77.0.27.3 (talkcontribs)

Dear Community,

I have exactly the same problem. I can upload images to wikimedia, but when I try to access them, it says "You don't have permission to access this resource.Server unable to read htaccess file, denying access to be safe"

The permissions for htaccess are set correctly though(either 664 or 775 doesn't work). Can anyone help me further with this`?


kind regards,

Stefan

DAChristiansen (talkcontribs)

Has anyone figured this issue out? I am able to upload images - but get the same error above - Am also able to change permissions on the .htaccess file but no combination seems to work.

Thanks in advance,

Dean

Reply to "Images not shown - "you don't have permission to access this resource""
213.112.235.32 (talkcontribs)

I have been searching the site for a definition of the username character rules without success. Need to know if the phpBB usernames in my forum is in accordance with the MediaWiki rules since I want to use the phpBB-extension to set up a document-wiki accessible for the forum users. Can someone point me to the rules?

Reach Out to the Truth (talkcontribs)

The first letter of a MediaWiki username is always capitalized (watch out for conflicts). They can be up to 255 characters long (Not sure what phpBB's limit is, but you probably don't have any user with names that long anyway). Underscores and spaces are considered the same thing (again, watch out for conflicts). And per Manual:$wgLegalTitleChars, "The list of illegal characters is as follows: #<>[]|{}, non-printable characters 0 through 31, and 'delete' character 127)."

I think that's all.

Wmyttmlimvty (talkcontribs)

255 characters re u kidding?

Reply to "Username rules"

How to display only part of an image

5
Xelgen (talkcontribs)

Hi folks,

Is there a way to display just small, defined area of image using MediaWiki's [[Image:]]?

Let's say you have a scan of book page, and you want to show only illustration on that page, without showing whole scanned page (with text, etc..). Speaking more techicaly let's say we have image of 1000x800px and you want to display only a small part of it starting from possition 200,50 and with height width, 100 and 300.

Is it currently possible? Or planned in near future? I guess this will be very useful, especially for Wikisource.

I've googled for a while, and looked thorugh MedaWiki manuals, but didn't find an answer. I understand that currently there's no way to make it using only HTML <img> tag, but this can be done, using block elements, or displaying image as background.

Thanks beforehad,

MarkAHershberger (talkcontribs)

You could probably do something with jcrop.

Xelgen (talkcontribs)

Yes, that's what I'm using now. But JCrop is good for making a crop selection, and after that we have to crop it on 3rd party server, and upload a new cropped version of files back to wiki.

What I meant, was to use something in native MediaWiki Syntax, e.g. [[Image:Book_page_scan1|crop=X1,Y1,X2,Y2|thumb|this image shows only portion of page with X1, Y1 topleft corner, and X2, Y2 bottom right corner]] without having to upload new file, and just using what we already have.

You can probably do something like this with Divs and templates, but then image will be div's background, and won't behave the way regular images do.

But in the end of the day, visitors will have to load full image, to see just small part of it, and as I wanted to use it for few thousands images, on hopefully popular pages, I guess cropping and uploading new cropped images, is the way to go.

Thanks for your response.

Dabed (talkcontribs)

I want the same but although this question is more than 11 years old I guess there is still no way to do it or did you learn how?

Wmyttmlimvty (talkcontribs)

Same here!

Reply to "How to display only part of an image"

Name a page from form parameter

1
BotBernard (talkcontribs)

Hi, i'm using this to give the result page the name of NomDossier parameter : page name=<Nom du dossier[NomDossier]>

I always en up with the following error message : Specified page <Nom_du_dossier[NomDossier]> is not valid. (The actual english error message may be a bit different as I translated it from French)

Here is the parameter I want to use for my name's page :

!Nom du dossier : |NomDossier

Does anyone know why it doesn't work ?

It's working on different pages and I have no idea why it doesn't with this form.

Reply to "Name a page from form parameter"

How do I change the colour?

4
MWQs (talkcontribs)

Can I make just slight modifications to the existing skins? I like the layout and functionality of vector (or whichever one it is that matches most Wikipedias?) but I want to give it some themed colours to suit our own

wikiCan I locate the file for that skin (where?) and just change a few he codes? Or is it more complicated than that?

Ciencia Al Poder (talkcontribs)

Do not touch installation files for this. That would complicate your upgrades.

Instead, generate override stylesheets on the wiki, as described in Manual:Interface/Stylesheets. You would create MediaWiki:vector.css or MediaWiki:vector-2022.css (depending on your vector skin) with the styles to override, usually just colors. You'd have to copy the entire selector to override and modify the colors as you wish, removing other rules that you don't want to modify.

Note that changes may not be applied immediately due to caching. You better try it yourself live on the page by using the browser's development tools, or in your personal stylesheet and using the preview button.

MWQs (talkcontribs)

@Ciencia Al Poder, thank you.

I think I understand you as far as I need to make my own copy of the skin before I customise it?

But I'm confused about step zero, which window do I open? - do I find those paths the way I would find other pages on the wiki through the browser? - or through the xamp etc. control panel? - or through my computer's file system?

Sorry I'm such a novice. A friend did most of the installation, so I've mostly been just editing pages, the rest is a bit of a black box to me.

I have my wiki just running locally currently, no on line, in case that makes any difference.

MWQs (talk) 07:55, 15 May 2024 (UTC)

Ciencia Al Poder (talkcontribs)

No, there's no need to make a copy of the skin. You only need to introduce the desired rules you want to change, not everything.

You can use developer tools of your browsers (hit F12) to inspect element and see the CSS it's using, and even change it to see how it would look. Then you can copy the rule to the CSS page. However, you need to understand the very basics of CSS (cascading stylesheets) to know what to do. I'd recommend you to look at any simple introduction tutorial to CSS.

Reply to "How do I change the colour?"

Force thumbnail generation with PdfHandler?

6
Kjecl (talkcontribs)

I recently performed an reinstall and database restore of a Wiki to fix a different problem. An unexpected positive side effect was that thumbnails are now generated for new PDF files uploaded to the Wiki. Cool!

Is there a way to force the generation of thumbnails for previously uploaded PDFs? I have tried:

php refreshImageMetadata.php -f

followed by:

php rebuildImages.php

without effect.

Thanks for any suggestions.

Bawolff (talkcontribs)

What do the old images look like? Is there an error message instead of a thumbnail or is it just missing. Does mediawiki show the correct dimensions for the files in question (as in, does it say it is 0x0 pixels or does it give a real number)?

Kjecl (talkcontribs)

Thank you for your interest in my problem.

The thumbnails for older files are a red stylized 'A' on a white background. Nope, no error message.

If I go to the Special:ListFiles page, and click on a red A icon, it shows dimensions of 0 x 0.

I wonder if I could use importImages.php to reload all of the older files. An experiment is in order for one of those files, I think.

Kjecl (talkcontribs)

Yes, I can use importImages.php to reload an older file. No, it does not help.

Bawolff (talkcontribs)

So the 0x0 usually means that Extension:PdfHandler had problems running the pdfinfo command, which would prevent the creating of thumbnails.

However if new files are working, then that means that it should be able to run the pdfinfo command.

In general, running refreshImageMetadata.php -f should fix that. Does the script actually say it refreshed the file in question? If it still isn't working, i could see two possible problems:

  • some sort of cache issue. You could try adding ?action=purge (or &action=purge ) to the end of the File: page (the page in the wiki, not the actual file) to see if that does anything to help
  • the older files aren't readable by the webserver. This could potentially happen if when you transfered webservers the image files had the wrong permissions or some other sandboxing system prevented access.

Both of those feel kind of a long shot though.

Of course its always possible the file being tested is just a broken pdf.

Kjecl (talkcontribs)

I used:

ls -lR | grep -v -e <string>

at the top level of the image upload folder, where string was either the owner or the permissions, to check that. I did not find any files with the wrong permissions or ownership.

refreshImageMetadata.php -f

does not say that it refreshed the files (~80 of them) in question. pdfinfo is able to run against all of the files in question sufficiently to report the PDF version. PDF versions for these files range from 1.3 to 1.7.

FILES=$(find $PREFIX -name "*.pdf" -type f | grep -v "/temp" | grep -v "/deleted" | grep -v "/archive" )

for F in $FILES; do

   echo $(pdfinfo $F | grep "PDF version")    $F

done

So, there are about 80 of these files with the 'red A' thumbnails. Apart from the likelihood of error, we could re-upload all of them to get the new thumbnails. We would prefer not to need to take that approach. Also, there is the concern that this symptom betides some problem that will bite us later.

Thanks again for your help.

Reply to "Force thumbnail generation with PdfHandler?"
2A02:A03F:66D9:F301:512D:41C:6D44:DFFF (talkcontribs)

Hello everyone !

I recently installed mediawiki with the 'Parser' extension.

But when I try to log in to my wiki, I get this error :

"[ZkDhPaXGad5SVb3nIP2RQAAAAAM] /wiki_test2/index.php?title=Accueil MWException: Parser state cleared while parsing. Did you call Parser::parse recursively? Lock is held by: #0 /var/www/alternc/t/titouan/www/queernet.xyz/wiki_test2/includes/parser/Parser.php(882): Parser->lock()"

Does anyone have an idea what might be causing this ?

Thanks :)

Bawolff (talkcontribs)

I have never heard of an extension named "Parser". Presumably the extension is broken.

2A02:A03F:66D9:F301:512D:41C:6D44:DFFF (talkcontribs)

i think the extension is called ParserFunctions. its under the Syntax Analyser Add-ons options when you install mediawiki

Bawolff (talkcontribs)

There is a very big difference between "Parser" and "ParserFunctions".

Normally the error message should be longer then that. The rest of the error message likely provides information on the cause of the problem.

Syntax Analyzer Add-ons is not a product we make (nor have i ever heard of it). If you are having trouble with a third party distribution of MediaWiki, consider using the official version at Download. The amount of help we can provide for unofficial distributions made by third parties is limited.

2A02:A03F:66D9:F301:2D10:2604:D876:5217 (talkcontribs)

Hey,

I don't think this is a third party issue since I downloaded via the official mediawiki site. However I might have gotten the name of the categories wrong since I installed it in French (it was called 'greffons d'analyseur syntaxique') and I'm not sure what the English name is.

The whole error message is pretty long so I'm going to spilt it to avoid getting blocked. Here is the first part :

[ZkIaXNlSSMkzRXDjL4XVsgAAACk] /wiki_test2/index.php?title=Accueil MWException: Parser state cleared while parsing. Did you call Parser::parse recursively? Lock is held by: #0 /var/www/alternc/t/titouan/www/queernet.xyz/wiki_test2/includes/parser/Parser.php(882): Parser->lock()

2A02:A03F:66D9:F301:2D10:2604:D876:5217 (talkcontribs)
Bawolff (talkcontribs)

I did not get the error when going to your site (maybe it only happens if not logged in), but the image of the error was what i needed.

I think its unlikely that this error has anything to do with the ParserFunctions extension.

Can you double check to make sure that your version of vector skin is the correct version for your wiki? Does the error message happen on other skins too or just vector?

If that doesn't work, i would suggest disabling all skins & extensions, then re-enabling them one by one to see if a specific extension/skin is causing it.

P.s. if there is something you're not sure what the english name of is, just also include the french name.

Reply to "parser error"

Scripted initial population of MediaWiki database

3
Dstahlberg (talkcontribs)

As part of an Ansible-scripted setup of a MediaWiki site, I need to configure MediaWiki. The LoadSettings.php can be prepared in advance and copied to the site, but is there a scripted way to initially populate the database without manually accessing the Installation page?

Thanks for any pointers and tips!

Bawolff (talkcontribs)

Use install.php script in the maintenance directory which can be run from commandline.

Alternatively you could just take a database dump of a fresh install and import that.

Bawolff (talkcontribs)

P.s. you might also be interested in the Meza project

Reply to "Scripted initial population of MediaWiki database"