Mediawiki configuration

Hi there, just trying to configure mediawiki to work with this extension called PandocUltimateConverter. It’s compiled fine but when I try exporting it I usually get an “Export failed (HTTP 404)” error.

{ config, pkgs, ... }:
{
  services.mediawiki = {
    enable = true;
    name = "wiki test";
    url = "https://wiki-domain.org";

    passwordFile = "/home/anon/.mediawiki/passwordFile";

    passwordSender = "wiki-admin@example.com";

    extensions = {
                   BulkBlock = pkgs.fetchzip {
                     url = "https://github.com/wikimedia/mediawiki-extensions-BulkBlock/archive/refs/heads/master.zip";
                     sha256 = "Mja5OvCFOui5eKH2Lz3iOE2HN+UVKB2FWAiDS0GClcA=";
                   };

                   PandocUltimateConverter = pkgs.fetchzip {
                     url = "https://github.com/Griboedow/PandocUltimateConverter/archive/refs/heads/main.zip";
                     sha256 = "fodGfJCWIykg8uCDIWWk94EMUYNUGmw9w0MCZUxvTZY=";
                   };

                   /*UserProfile = pkgs.fetchzip {
                     url = "https://github.com/wikimedia/mediawiki-extensions-UserProfile/archive/refs/heads/master.zip";
                     sha256 = "BSBg8+hRDTSjhCKrsr1xLvpavUg+VUykNQvGsn2CeXo=";
                   };*/

                   ParserFunctions = null;
    };

    extraConfig = ''
      $wgServer = "https://burma-wiki.globi.uk";
      $wgShowExceptionDetails = true;error_reporting ( -1   );ini_set('display_errors', 1);
      $wgDefaultSkin = 'vector';
      $wgLogos = [
        '1x' => "images/4/41/Arrow.png",
      ];

      wfLoadExtension( 'PandocUltimateConverter' );
      wfLoadExtension( 'Cite' );
      wfLoadExtension( 'CategoryTree' );

      wfLoadExtension( 'Scribunto' );
      $wgScribuntoDefaultEngine = 'luastandalone';

      wfLoadExtension( 'TemplateStyles' );
      /*wfLoadExtension( 'UserProfile' );*/

      /*permissions*/
      $wgGroupPermissions['*']['edit'] = false;

      /*copyright*/
      $wgRightsPage = "Template:GFDL";
      $wgRightsText = "GFDL";

      $wgRightsIcon = "/images/a/ad/Gfdl-logo-small.png";

      /*Captcha with questions*/
      wfLoadExtensions([ 'ConfirmEdit', 'ConfirmEdit/QuestyCaptcha' ]);
      $wgCaptchaClass = 'QuestyCaptcha';

      $wgCaptchaQuestions = [

      'Is this a test?' => 'Yes',

      ];

      wfLoadExtension( 'BulkBlock' );
      wfLoadExtension( 'Nuke' );

      $wgEnableUploads = true;
      $wgFileExtensions[] = 'pdf';
      $wgFileExtensions[] = 'docx';

      /*$wgScriptPath = "/w";
      $wgArticlePath = "/wiki/$1";
      $wgUsePathInfo = true;*/
    '';

    virtualHost.listen = [{
        ip = "127.0.0.1";
        port = 9000;
        ssl = false;
    }];
  };
}

I’ve declared the dependencies for it in my configuration.nix like so:

environment.systemPackages = with pkgs; [
vim
docker

#mediawiki pandoc install

pandoc
texliveFull
libreoffice
poppler-utils
poppler
];

It’s possible it could just be an error with the extension itself, but I’ve checked and there haven’t been any relevant issues in regards to the problem I’m having specifically and it did compile just fine afterall, so I’m assuming it may have something to do with how NixOS may handle things internally. I’m semi-new to NixOS so I’m not quite sure myself since I’ve tried installing the dependencies from the extension’s page.

Would appreciate the help!

1 Like

I don’t know much about MediaWiki, but two things come to mind:

  1. Can you get a server log associated with the 404 from journalctl and post it?
  2. Adding dependencies to environment.systemPackages isn’t generally the right thing — if it ever makes a difference, it’s only because a package has been insufficiently Nixified. (One of the core ideas of Nix is that software deployed with it should behave identically regardless of what other things you’ve deployed in parallel, after all!) If your extension has dependencies on other packages you probably have to add them to services.mediawiki.path instead. environment.systemPackages is only for things you’re going to use directly.
2 Likes

Okay I’ve set the path right like so:

path = with pkgs; [ pandoc texliveFull libreoffice poppler-utils poppler ];

It’s still giving me the error nonetheless and here’s my journalctl:
journalctl -u phpfpm-mediawiki.service -b
Mar 31 16:42:26 nixos systemd[1]: Starting PHP FastCGI Process Manager service for pool mediawiki…
Mar 31 16:42:26 nixos php-fpm[2006]: [31-Mar-2026 16:42:26] NOTICE: systemd watchdog configured to 7.5sec
Mar 31 16:42:26 nixos php-fpm[2006]: [NOTICE] fpm is running, pid 2006
Mar 31 16:42:26 nixos php-fpm[2006]: [NOTICE] ready to handle connections
Mar 31 16:42:26 nixos systemd[1]: Started PHP FastCGI Process Manager service for pool mediawiki.
Mar 31 16:42:26 nixos php-fpm[2006]: [NOTICE] systemd monitor interval set to 7500ms
Mar 31 23:04:26 nixos php-fpm[2006]: [NOTICE] Terminating …
Mar 31 23:04:26 nixos systemd[1]: Stopping PHP FastCGI Process Manager service for pool mediawiki…
Mar 31 23:04:26 nixos php-fpm[2006]: [NOTICE] exiting, bye-bye!
Mar 31 23:04:26 nixos systemd[1]: phpfpm-mediawiki.service: Deactivated successfully.
Mar 31 23:04:26 nixos systemd[1]: Stopped PHP FastCGI Process Manager service for pool mediawiki.
Mar 31 23:04:26 nixos systemd[1]: phpfpm-mediawiki.service: Consumed 2min 31.788s CPU time, 195.6M memory peak, 52M read from disk, 9.5M written to disk.
Mar 31 23:04:27 nixos systemd[1]: Starting PHP FastCGI Process Manager service for pool mediawiki…
Mar 31 23:04:27 nixos php-fpm[510689]: [31-Mar-2026 23:04:27] NOTICE: systemd watchdog configured to 7.5sec
Mar 31 23:04:27 nixos php-fpm[510689]: [NOTICE] fpm is running, pid 510689
Mar 31 23:04:27 nixos php-fpm[510689]: [NOTICE] ready to handle connections
Mar 31 23:04:27 nixos php-fpm[510689]: [NOTICE] systemd monitor interval set to 7500ms
Mar 31 23:04:27 nixos systemd[1]: Started PHP FastCGI Process Manager service for pool mediawiki.

Appreciate the help!

Oh, that’s not much to go on. My bad, I forgot that Apache doesn’t use the journal by default. Is there a /var/log/httpd/error_log or something?

1 Like

Here you go this is what I found in the /var/log directory for httpd, thanks for the help, and that was my bad I probably should’ve looked into that too or been more explicit:

cat error.log
[Tue Mar 31 00:00:07.071990 2026] [mpm_event:notice] [pid 2752129:tid 2752129] AH00489: Apache/2.4.66 (Unix) configured – resuming normal operations
[Tue Mar 31 00:00:07.072032 2026] [core:notice] [pid 2752129:tid 2752129] AH00094: Command line: ‘httpd -f /etc/httpd/httpd.conf’
[Tue Mar 31 16:09:11.864034 2026] [mpm_event:notice] [pid 2752129:tid 2752129] AH00492: caught SIGWINCH, shutting down gracefully
[Tue Mar 31 16:09:12.957947 2026] [mpm_event:notice] [pid 2018601:tid 2018601] AH00489: Apache/2.4.66 (Unix) configured – resuming normal operations
[Tue Mar 31 16:09:12.958061 2026] [core:notice] [pid 2018601:tid 2018601] AH00094: Command line: ‘httpd -f /etc/httpd/httpd.conf’
[Tue Mar 31 16:41:54.026355 2026] [mpm_event:notice] [pid 2018601:tid 2018601] AH00492: caught SIGWINCH, shutting down gracefully
[Tue Mar 31 16:42:24.843168 2026] [mpm_event:notice] [pid 986:tid 986] AH00489: Apache/2.4.66 (Unix) configured – resuming normal operations
[Tue Mar 31 16:42:24.844564 2026] [core:notice] [pid 986:tid 986] AH00094: Command line: ‘httpd -f /etc/httpd/httpd.conf’
[Tue Mar 31 19:00:05.605868 2026] [mpm_event:notice] [pid 986:tid 986] AH00493: SIGUSR1 received. Doing graceful restart
[Tue Mar 31 19:00:05.664838 2026] [mpm_event:notice] [pid 986:tid 986] AH00489: Apache/2.4.66 (Unix) configured – resuming normal operations
[Tue Mar 31 19:00:05.664878 2026] [core:notice] [pid 986:tid 986] AH00094: Command line: ‘httpd -f /etc/httpd/httpd.conf’
[Tue Mar 31 23:00:50.546588 2026] [mpm_event:notice] [pid 986:tid 986] AH00492: caught SIGWINCH, shutting down gracefully
[Tue Mar 31 23:00:51.782852 2026] [mpm_event:notice] [pid 504705:tid 504705] AH00489: Apache/2.4.66 (Unix) configured – resuming normal operations
[Tue Mar 31 23:00:51.782994 2026] [core:notice] [pid 504705:tid 504705] AH00094: Command line: ‘httpd -f /etc/httpd/httpd.conf’
[Tue Mar 31 23:11:00.450020 2026] [mpm_event:notice] [pid 504705:tid 504705] AH00492: caught SIGWINCH, shutting down gracefully
[Tue Mar 31 23:11:24.859686 2026] [mpm_event:notice] [pid 978:tid 978] AH00489: Apache/2.4.66 (Unix) configured – resuming normal operations
[Tue Mar 31 23:11:24.954918 2026] [core:notice] [pid 978:tid 978] AH00094: Command line: ‘httpd -f /etc/httpd/httpd.conf’

And just to be sure, these logs include the time period during which you tried to do an export and got an error?

Anything useful in the access log? You don’t have to post the whole thing; it might be more sensitive. Just look for the lines corresponding to the error you got, maybe a few before and after for context.

If you can’t find anything there then I might be at the end of my ability to help, sadly.

1 Like

Yeah this is pretty much it I tried using the debugging option listed:

$wgDebugLogGroups[‘PandocUltimateConverter’] = ‘/var/log/mediawiki/pandoc.log’;

Nothing came out, like no file was generated, and yes these are the logs from today exactly. I’ll just try seeing if it’s possibly an issue in the issues page for the extension. Thanks for the help either way.

Good luck! Maybe someone with more specific experience can take over from me.

1 Like

Hi just wanted to ask what the specific path for the pandoc specified in the mediawiki module would be exactly? Apparently it was a known issue for the extension and it got to pandoc where it started looking around for it but now it’s saying that it can’t find pandoc despite having specified it in the path already. The configuration for the module is still the same by the way.

All I need now is just the path for the pandoc being used within the mediawiki dependency so I can explicitly state it for the extension option using this:

$wgPandocUltimateConverter_PandocExecutablePath = “/path/”;

For reference:

Thanks for the help by the way, appreciate it a lot. I don’t really know how to check for paths within modules of mediawiki.

Oh also here’s the issue: Mediawiki export and import error · Issue #46 · Griboedow/PandocUltimateConverter · GitHub

${lib.getExe pkgs.pandoc} as long as you keep declaring the settings PHP in Nix.

1 Like

Thanks it worked, but now it’s asking me for permissions, docx documents work now though, just not pdfs maybe just a weird way with how for the extension pandoc is directly used for docx documents. I’ll check it with the maintainer to see if that’s the case just in case it’s just the extension.

The maintainer enabled an option where the pdf engine for exporting using pandoc can be changed now like so:

$wgPandocUltimateConverter_PdfExportEngine = '/path/to/yourPdfEngine';

I just added wkhtmltopdf to the list of dependencies added it as ${lib.getExe pkgs.wkhtmltopdf}and I’m able to export pdfs just fine now. Thanks for the help everyone! ;D

Keep progress on the issue here: Mediawiki export and import error · Issue #46 · Griboedow/PandocUltimateConverter · GitHub

Currently using this branch, not sure if it will get merged or not but I’m going to leave it here for anybody in the future: GitHub - Griboedow/PandocUltimateConverter at pdf-export-engines · GitHub

1 Like