Skip to main content

How to Enable Error logs - MediaWiki

This article explains how to enable detailed error logging in MediaWiki.

Updated over 3 weeks ago

⚠️ Always disable debug mode after troubleshooting is complete.

Prerequisites

  • Access to cPanel

  • Ensure PHP error logging is enabled in cPanel

Completion of the task: 10 minutes

Expertise: beginner

How to do?

  1. Open File Manager or connect via FTP

  2. Edit the file LocalSettings.php

  3. Add or modify the following lines:

    $wgShowExceptionDetails = true;
    $wgShowDBErrorBacktrace = true;
    $wgDebugLogFile = "/Path/to/user/mediawiki-debug.log";
  4. Save the file.


Log File Location

Custom path defined in $wgDebugLogFile

Disable Debug Logging

Remove or comment out the debug lines after troubleshooting.

Did this answer your question?