Jump to content

Topic on Project:Support desk

MediaWiki Site Not showing Styles - LocalSettings.php

7
Mhuartamendia (talkcontribs)

Hey guys, new to the forum and the WikiMedia Project, glad to be here!

So I finally set up MediaWiki 1.27.1 (I know it's not the latest heh) and setup through initial configuration.

However, when I put the LocalSettings.php file in /var/www/mediawiki and access the main wiki page, CSS styles are not applied and the page looks bad, I will upload screenshots showing this, also showing the "inspect element" errors on the browser, and the local settings php file content. I know through other threads I've seen, that it has something to do with this :).


Edit: I edited the $wgServer variable on LocalSettings.php file for the hostname instead of the IP address (I created a local DNS A Record as well) and still no luck. I also read this: Manual:Errors and symptoms#The wiki appears without styles applied and images are missing and found load.php shows "In this request, no modules were requested. Max made me put this here. */" so it says there might be problems with .htaccess file, but at this point I need some guidance.

Ciencia Al Poder (talkcontribs)

Open the URL of the stylesheets that give those MIME type errors (you can click on the URL at the developer console) and see if the page is an error page.

Mhuartamendia (talkcontribs)

Thanks for the reply!


So I have three clickable links on the developer console on the browser and each one of them returns a page stating "Exception encountered, of type "Error" (it takes me to mediawiki.mydomain/mediawiki.load.php.) Any ideas? HTAccess are not created on the path of the MediaWiki, so rewrites may have nothing to do with this. At this point, I'm suspecting permissions might have to do with it.

Bawolff (talkcontribs)

Set $wgShowExceptionDetails = true; in LocalSettings.php . This will give you more detailed error messages.

I think its unlikely to be permission related.

Mhuartamendia (talkcontribs)

Ok, so this is what it throws when enabling exception details:

Exception encountered, of type "Error"

[XjhNg6So5dm0pad9ZKwy-QAAAAY] /mediawiki/load.php?debug=false&lang=en&modules=startup&only=scripts&skin=modern Error from line 663 of /var/www/html/mediawiki/includes/exception/MWExceptionHandler.php: Class 'FormatJson' not found

Backtrace:

#0 /var/www/html/mediawiki/includes/exception/MWExceptionHandler.php(242): MWExceptionHandler::logError(ErrorException, string)

#1 /var/www/html/mediawiki/includes/AutoLoader.php(81): MWExceptionHandler::handleError(integer, string, string, integer, array)

#2 /var/www/html/mediawiki/includes/AutoLoader.php(81): require()

#3 [internal function]: AutoLoader::autoload(string)

#4 /var/www/html/mediawiki/includes/cache/MessageBlobStore.php(243): spl_autoload_call(string)

#5 /var/www/html/mediawiki/includes/cache/MessageBlobStore.php(163): MessageBlobStore->generateMessageBlob(ResourceLoaderFileModule, string)

#6 /var/www/html/mediawiki/includes/cache/MessageBlobStore.php(116): MessageBlobStore->recacheMessageBlob(string, ResourceLoaderFileModule, string)

#7 /var/www/html/mediawiki/includes/resourceloader/ResourceLoader.php(152): MessageBlobStore->getBlobs(array, string)

#8 /var/www/html/mediawiki/includes/resourceloader/ResourceLoaderStartUpModule.php(397): ResourceLoader->preloadModuleInfo(array, DerivativeResourceLoaderContext)

#9 /var/www/html/mediawiki/includes/resourceloader/ResourceLoaderStartUpModule.php(379): ResourceLoaderStartUpModule->getAllModuleHashes(DerivativeResourceLoaderContext)

#10 /var/www/html/mediawiki/includes/resourceloader/ResourceLoaderModule.php(707): ResourceLoaderStartUpModule->getDefinitionSummary(DerivativeResourceLoaderContext)

#11 /var/www/html/mediawiki/includes/resourceloader/ResourceLoader.php(622): ResourceLoaderModule->getVersionHash(DerivativeResourceLoaderContext)

#12 [internal function]: ResourceLoader->{closure}(string)

#13 /var/www/html/mediawiki/includes/resourceloader/ResourceLoader.php(623): array_map(Closure, array)

#14 /var/www/html/mediawiki/includes/resourceloader/ResourceLoader.php(675): ResourceLoader->getCombinedVersion(ResourceLoaderContext, array)

#15 /var/www/html/mediawiki/load.php(47): ResourceLoader->respond(ResourceLoaderContext)

#16 {main}

I tried verifying JSON module is active on my PHP 7.3 installation and it is. However the error is not fixed yet.

Remember my version of mediawiki is 1.27, there might be incompatibility issues with this version?

Mhuartamendia (talkcontribs)

It seems I resolved this issue by adding this line to LocalSettings.php:

require_once("$IP/includes/json/FormatJson.php");

The error 500 is gone. So this works, but why???

Ciencia Al Poder (talkcontribs)

MediaWiki 1.27 is not compatible with PHP 7.3. It's not the first report of this problem with MediaWiki 1.27 on PHP 7.3 https://phabricator.wikimedia.org/T90430#5236940

Please upgrade to a supported MediaWiki version, since your version is obsolete and with potential security vulnerabilities.

Reply to "MediaWiki Site Not showing Styles - LocalSettings.php"