Mediawiki troubleshooting

From wikinotes
Revision as of 19:13, 11 July 2020 by Will (talk | contribs) (→‎Debug Info)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Debug Info

/usr/local/www/mediawiki/LocalSettings.php
# place immediately under <?php in LocalSettings.php
error_reporting( -1 );
ini_set( 'display_errors', 1 );
$wgShowExceptionDetails = true;
$wgShowDBErrorBacktrace = true;
$wgShowSQLErrors = true;

You can also log mediawiki to a file.
If you take this route, consider using logrotate to keep the log size down.

$wgDebugLogFile = "/var/log/mediawiki/mediawiki.log";

Login Exception

If you are unable to login (and you are not serving your wiki via SSL), this is likely caused by using an insecure login method. You can ignore these exceptions by adding the following to your LocalSettings.php.

$wgSessionInsecureSecrets = true

If you have just updated your mediawiki installation to a new version, you might need to run /usr/local/www/mediawiki/maintenance/update.php.

Missing PHP modules

If you have a working install, but when trying to visit your wiki in a web-browser, you are presented with a page complaining about missing php extensions, this is how you can resolve them.

php -m   ## lists all installed php extensions
pkg install php56-composer

# cd into directory with composer.json
# and follow directions. generally composer install ...

Wiki looks like raw HTML

If the wiki is being displayed, but the styles are not being applied (looks like html page), it is likely because your Browser is having a difficult time detecting the server. $wgServer in your LocalSettings.php is meant to point to your server's external IP.

I commented out this line so that the host would be determined by 'WebRequest::detectServer()'. And the wiki is now working properly under windows.